Entrust is a plugin to add role-based permissions to Laravel.
Questions tagged [entrust]
115 questions
0
votes
1 answer
Laravel 5.2 Access control list
I am new to Laravel, and feeling very uncomfortable about embedding the "Entrust" plugin in Laravel 5.2.
Can any one please tell me how I can embed "Entrust" in Laravel 5.2?

Bilal Awan
- 43
- 6
0
votes
3 answers
Laravel 5.2 with Entrust - Class name must be a valid object or a string
I have a problem when register a user, after save user in my table users, I try assign role for this user but I receive the error :
Class name must be a valid object or a string.
my code is…

Jose
- 3
- 1
- 3
0
votes
1 answer
Using middleware route filer in Entrust for Laravel
I have used Entrust for laravel, everything works fine until I used the middleware route filter.
Like I said everything works fine apart from the middlware filter. I have added the routemiddleware array to kernel. So this is basically what the…

shaNnex
- 1,043
- 2
- 19
- 34
0
votes
1 answer
After attaching permissions to role still getting false in can() method
I am using entrust to manage roles and permission in my application. I am having trouble to call method attachPermission() on user. Then I tried it another way I assigned all permissions to a role. When I sign-in using that user I get false for…

tmw
- 1,424
- 1
- 15
- 26
0
votes
2 answers
Eloquent User Where Clause with Entrust Library
I'm trying to select all users for a company. But only users who has "admin" role status (Entrust, etc.).
User::where('company_id', Auth::user()->company_id)->hasRole('admin')->get();
The above is throwing an error. Left a bit lost on how to run…

Mike Barwick
- 6,288
- 6
- 51
- 76
-1
votes
2 answers
Call to undefined method Illuminate\Database\Query\Builder::attachRole()
When I create a user and try to attach roles to it, I get the error cited below. How can I fix the code?
Call to undefined method Illuminate\Database\Query\Builder::attachRole()
public function store(Request $request)
{
…

Vit IT
- 1
-1
votes
1 answer
Laravel 5.5 The page has expired due to inactivity
I used laravel 5.4 and Zizaco/entrust.
Today I upgrade my project to
Laravel 5.5.
When I want to login in my project show me this error
The page has expired due to inactivity.
Please refresh and try again.
I changed SESSION_DRIVER=file to…

paranoid
- 6,799
- 19
- 49
- 86
-1
votes
1 answer
Laravel 5.4 Zizaco/entrust - user soft delete
How can I prevent detaching of roles on user soft delete?
$user->hasRole('subscriber') => true
$user->delete()
$user->hasRole('subscriber') => false
$user->restore()
$user->hasRole('subscriber') => false

fiter
- 743
- 1
- 12
- 25
-1
votes
2 answers
entrust delete() error Class name must be a valid object or a string
i use below code for remove one record from roles table:
if ( $role = Role::find($id)) {
$role->delete();
return response()->json(['status' => 'success', 'message' => 'operation was successful.']);
}
but, an error happen and the message…

Meysam Valiolahi
- 188
- 1
- 1
- 12
-2
votes
1 answer
How to Upgrade Laravel 5.4 to Laravel 7.12
In my old project laravel 5.4, use zizaco/entrust and it's doesn't support laravel 7. So I would like to use spatie/laravel-permission.
Could you please guide me how to do it.

HKimhab
- 1
- 1
- 3