我在My Controller中使用此功能添加权限值。
public function addPermission(Request $request, $id, Permission $permission)
{
$this->validate($request, [
'status' => 'required'
]);
$permission = new Permission;
$permission->status = $request->input('status');
$permission->project_id = $id;
$permission->collaborator_id = $request->input('cid');
$permission->save();
return redirect()->back()->with('info','Permission has been added to your Collaborator successfully');
}
当我更改权限值时,如何使用if else条件在此处编写更新代码?