Level 60
Your route does not have wild card
// wrong
Route::put('/profile',ProfilesController@update')
// correct
Route::put('/profile/{id}', 'ProfilesController@update');
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am getting this error but cannot figure out why
Too few arguments to function App\Http\Controllers\ProfilesController::update(), 1 passed and exactly 2 expected
public function update(Request $request, $id)
{
$this->validate($request, [
'name' => 'required'
]);
$user = User::find($id);
// Handle File Upload
// Update Post
$user->name = $request->input('name');
$user->save();
return redirect('profile.profile')->with('success', 'Profile Updated');
}
@artisticre now when you send the request, make sure you include the ID
<form action="/profile/{{ $user-> id }}"
or
// instead of
$user = User::find($id);
// use
$user = auth()->user()
Please or to participate in this conversation.