app/Http/Controllers/DepartmentController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\Department  $department
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request,$id)
    {
        $department = Department::find($id);
        $department->name = $request->input('name');
        $department->save();
        return redirect()->route('departments.index');
    }
public function update ( Request $ request , $ id ) { $ department = Department :: find ( $ id ) ; $ department -> name = $ request -> input ( 'name' ) ; $ department -> save ( ) ; return redirect ( ) -> route ( 'departments.index' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .