本文整理匯總了PHP中app\Role::update方法的典型用法代碼示例。如果您正苦於以下問題:PHP Role::update方法的具體用法?PHP Role::update怎麽用?PHP Role::update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\Role
的用法示例。
在下文中一共展示了Role::update方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Role $role)
{
$this->validate($request, ['role' => 'required|min:3|max:80', 'description' => 'min:8|max:480']);
$role->update($request->all());
return redirect()->route('admin.roles.index')->withInfo("The role {$role->role} was updated...");
}
示例2: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Role $role)
{
$role->update($request->input());
$this->sync($role, $request);
return redirect()->action('RolesController@index');
}
示例3: update
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Requests\Admin\RoleRequest $request, Role $role)
{
$role->update($request->all());
return redirect('/admin/role')->with('flash_success', 'Роль успешно обновлена.');
}
示例4: update
/**
* Update the specified resource in storage.
*
* Requests\PanelRoleRequest $request
* @param App\Role $role
* @return Response
*/
public function update($role, Requests\PanelRoleRequest $request)
{
$role->update($request->all());
$this->SyncPermissions($role, $request->input('permission_list'));
return redirect()->route('webpanel.panel.roles.index');
}