Please search first as there has been quite a few post on Authentication admins roles etc.
Jul 25, 2016
4
Level 12
Roles and Permissions with admins table
I am using table "admins" instead of "users" and using roles and permissions. Also I used the all codes same like in the tutorial, but I am not getting the proper result This is the code am using in AuthServiceProvider.php
public function boot(GateContract $gate)
{
$this->registerPolicies($gate);
foreach ($this->getPermissions() as $permission) {
$gate->define($permission->name, function($admin) use ($permission){
return $admin->hasRole($permission->roles);
});
}
}
public function getPermissions(){
return Permission::with('roles')->get();
}
I am new to Laravel please provide a solution I followed this tutorial "https://laracasts.com/series/whats-new-in-laravel-5-1/episodes/16"
Please or to participate in this conversation.