app/Http/Controllers/LecturerController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, Lecturer $lecturer)
    {
        $request->validate([
            'firstname' => 'required',
            'lastname'  => 'required', 
        ]);
        $lecturer->update([
            'firstname' => ucwords($request->firstname),
            'lastname'  => ucwords($request->lastname)
        ]);
        return redirect()->back()->with('success', 'Lecturer has been updated successfully');
    }
public function update ( Request $ request , Lecturer $ lecturer ) { $ request -> validate ( [ 'firstname' => 'required' , 'lastname' => 'required' , ] ) ; $ lecturer -> update ( [ 'firstname' => ucwords ( $ request -> firstname ) , 'lastname' => ucwords ( $ request -> lastname ) ] ) ; return redirect ( ) -> back ( ) -> with ( 'success' , 'Lecturer has been updated successfully' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .