本文整理汇总了PHP中app\helpers\Helper::makeSlug方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::makeSlug方法的具体用法?PHP Helper::makeSlug怎么用?PHP Helper::makeSlug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\helpers\Helper
的用法示例。
在下文中一共展示了Helper::makeSlug方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
// dd($request->assign_permission);
//array to hold final permission values
$array_of_permissions = Helper::prepPermissions($request->assign_permission, 'true');
//create new role
$role = \Sentinel::getRoleRepository()->createModel()->create(['name' => $request->role, 'slug' => Helper::makeSlug($request->role)]);
//retreive id of last inserted role
$role_id = $role->id;
$role = \Sentinel::findRoleById($role_id);
//assign permissions to role
$role->permissions = $array_of_permissions;
$role->save();
//assign newly created role to coder
$credentials = ['login' => 'umahatokula@ovalsofttechnologies.com'];
$user = \Sentinel::findByCredentials($credentials);
$role->users()->attach($user);
return \Redirect::to('settings/roles');
}