I think
$body['user_id'] = $user()->id;
should be
$body['user_id'] = $user->id;
More Related Contents:
- What does the random(1, 6) means in laravel scheduling? [duplicate]
- Property Property Property [title] does not exist on this collection instance does not exist on this collection instance does not exist on this collection instance
- Giving my function access to outside variable
- Laravel 5 – How to access image uploaded in storage within View?
- How to do this in Laravel, subquery where in
- Laravel Eloquent Query Using WHERE with OR AND OR?
- How to create Helper Methods on Laravel not a Facade
- Laravel update model with unique validation rule for attribute
- Get the Query Executed in Laravel 3/4
- Laravel – htmlspecialchars() expects parameter 1 to be string, object given
- What does “Mass Assignment” mean in Laravel?
- Laravel Checking If a Record Exists
- SQLSTATE[42S22]: Column not found: 1054 Unknown column – Laravel
- Accessing Laravel .env variables in blade
- Why do I have to run “composer dump-autoload” command to make migrations work in laravel?
- laravel TokenMismatchException in ajax request
- Laravel 5 hasMany relationship on two columns
- Get variables from the outside, inside a function in PHP
- How to pass a PHP variable to Vue component instance in Laravel blade?
- PHP – Add link to a URL in a string
- Laravel 5 – Clear Cache in Shared Hosting Server
- Laravel: Validation unique on update
- Laravel 5 change public_path()
- Laravel Recursive Relationships
- Passing data from controller to view in Laravel
- Laravel Eloquent – Attach vs Sync
- Issue with Laravel Rules & Regex (OR) operator
- How to Validate on Max File Size in Laravel?
- SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known
- Laravel SQLSTATE[HY000] [2002] Connection refused