1👍
sry i wrote wrong answer, because i could not write comment
you using wrong class.
try import this
use Illuminate\Support\Facades\Auth;
0👍
Try this:
$user = Auth::user();
$comment = $post->comments()->create([
'body' => $request->body,
'user_id' => $user->id
]);
- [Vuejs]-Vue props is undefined when print component dynamically
- [Vuejs]-Data change updating at random – Vue/Vuex
Source:stackexchange.com