#271

Thats because in your view component you are passing an integer (id) and then in your Controller you are expecting an eloquent model. You can do either of the following:

(1) Pass an eloquent model in view and depedency inject a model in the controller as follows:

<form method=”POST” action=”{{route(‘users.update’,auth()->user() )}}>
$csrf
@method(‘patch’)

</form>

Here is my Controller:

public function update(Request $request, User $user) {

}

(2) Pass an integer and also expects and pass it in the update method of the controller

<form method=”POST” action=”{{route(‘users.update’, auth()->user()->id)}}>
$csrf
@method(‘patch’)

</form>

Here is my Controller:

public function update(Request $request, $id) {

}