DEV Community

Discussion on: Easily use UUIDs in Laravel

Collapse
risingad profile image
Rising • Edited on

I am getting issue with sync() method.
I did somthing like:

$page->users()->sync([auth()->id() => ['status_id' => 1]]);
Enter fullscreen mode Exit fullscreen mode

then i got this error:

SQLSTATE[HY000]: General error: 1364 Field 'page_id' doesn't have a default value 
Enter fullscreen mode Exit fullscreen mode
Collapse
risingad profile image
Rising
wilburpowery image
I am using laravel version 5.7