app/Http/Controllers/EmployeeController.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, $id)
    {
        $request->validate([
            'name' => 'required',
            'email' => 'required|email',
            'companyId' => 'required',
        ]);
        $data = $request->except(['_token']);
        $employee = Employee::findOrFail($id);
        $employee->update($data);
        session()->flash('message','Employee Update Successfully!!');
        return redirect()->route('employee.index');
    }
public function update ( Request $ request , $ id ) { $ request -> validate ( [ 'name' => 'required' , 'email' => 'required|email' , 'companyId' => 'required' , ] ) ; $ data = $ request -> except ( [ '_token' ] ) ; $ employee = Employee :: findOrFail ( $ id ) ; $ employee -> update ( $ data ) ; session ( ) -> flash ( 'message' , 'Employee Update Successfully!!' ) ; return redirect ( ) -> route ( 'employee.index' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .