using put route with update method on lumen
Please I need help I use put route on lumen to update user but put update method does not work as I can not receive any data on it through a put route
@Sergiu17
this is the route
$router->put('update/{id}','DeviceController@update');
and this is the update method
public function update(Request $request,$id){
$this->validate($request,[
'name'=>['required',Rule::unique('departments','name')->ignore($id,'id')]
]);
$department = Department::find($id);
$department->name = $request->name;
$department->save();
return response($department);
}
@Elkomy which part doesn't work? And how does the frontend look?
Please or to participate in this conversation.