laravel-entrust-role-permission-panel
laravel-entrust-role-permission-panel copied to clipboard
Simple example to assign permissions to roles with Laravel and Entrust
When registering trough built in Laravel registration no role is attached to user! What would be the bast way and where add it so role would be attached to user...
I am using L-5 and it should be: `` to ``
``` public function handle($request, Closure $next) { $user = $this->auth->user(); $permissions = $this->permission->all(); $uri = $request->route()->uri(); foreach($permissions as $permission) { if( ! $user->can($permission->name) && $permission->route == $uri) { abort(403); }...
<php $checked = in_array($role->id, $userRoles->lists('id')); ?> fix like: <?php $checked = in_array($role->id, $userRoles->lists('id')->all()); ?>
Wanted to ask, what would be best way to impliment this? now I am using helpers.php where I check what is route, and if route = request I return active...