Open krekas opened 1 year ago
Thank you, appreciate the feedback. I have following question about that.
$project = Auth::user()->projects()->update([
'name' => $request->name,
'description' => $request->description
]);
This line of code will update the project for authorised user, right?
Yes, you are corrent. For the current authenticated user
You have
projects
relation in youruser
model. So instore()
method here https://github.com/danielveselinov/BrainsterProjects_DanielVeselinovWD6/blob/project03/app/Http/Controllers/ProjectController.php#L45 you can write:Link to docs https://laravel.com/docs/10.x/eloquent-relationships#the-create-method