artisticre
1 month ago
199
7
Laravel

Laravel Update

Posted 1 month ago by artisticre

I cannot figure out what is happening here: Too few arguments to function App\Http\Controllers\ManageController::update(), 0 passed and exactly 1 expected

What am I doing wrong?

public function update($id) {

 $this->validate($request(), [
     'Fname' => 'required',
     'Lname' => 'required',
     'email' => 'required|email|unique:users',
 ]);

 $user = Auth::user();

 $user->Fname = $request('Fame');
 $user->Lname = $request('Lname');

 $user->email = $request('email');


 $user->save();

 // $user = User::findOrFail($id);
 //   $user->update(Request::all());
      return view('profile')
                      ->with('success','Product updated successfully');
  }

Please sign in or create an account to participate in this conversation.