/**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(PermissionsRequest $request, $id)
 {
     $module_name = $this->module_name;
     $module_name_singular = str_singular($this->module_name);
     $module_name_singular = Permission::findOrFail($id);
     $module_name_singular->update($request->all());
     return redirect("admin/{$module_name}")->with('flash_success', "Update successful!");
 }
Example #2
0
 /**
  * Update the specified resource in storage.
  *
  * @param PermissionsRequest|Request $request
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function update(PermissionsRequest $request, $id)
 {
     $permission = Permission::findOrFail($id);
     $permission->update($request->only('name', 'display_name', 'description', 'model'));
     return redirect(route('admin.permissions.index'))->with('success', 'The permission has been updated.');
 }