app/Http/Controllers/EmployeeController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\Employee  $employee
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, Employee $employee)
    {
        $updateData = $request->validate([
            'fname' => 'required|max:255',
            'lname' => 'required|max:255',
            'email' => 'required|max:255',
            'phone' => 'required|max:12',
            'dob' => 'required|max:55',
            'company_id' => 'required|max:255',
        ]);
        Employee::whereId($employee->id)->update($updateData);
        return redirect('/employees')->with('completed', 'employee has been updated');
    }
public function update ( Request $ request , Employee $ employee ) { $ updateData = $ request -> validate ( [ 'fname' => 'required|max:255' , 'lname' => 'required|max:255' , 'email' => 'required|max:255' , 'phone' => 'required|max:12' , 'dob' => 'required|max:55' , 'company_id' => 'required|max:255' , ] ) ; Employee :: whereId ( $ employee -> id ) -> update ( $ updateData ) ; return redirect ( '/employees' ) -> with ( 'completed' , 'employee has been updated' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .