I want to get id of current user who submit a form. In Controller I use `auth()->id()` to get id of user but I get SQL error that say `Column 'user_id' cannot be null`. What causes this problem? I wrote following code:

```
Post::create([
    'title' => request('title'),
    'body' => request('body'),
     'user_id' => auth()->id()
]);

```

Thanks in Advance.