29 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
82
views
Laratrust role not updating until php artisan optimize:clear
I’m using Laravel 11 with Laratrust v8.3, and I’ve noticed something strange on my production server.
When I assign or update a user’s role, it doesn’t take effect immediately — the user still has the ...
0
votes
0
answers
42
views
Laratrust 8.5 isAbleTo() method causing Call to a member function setRelation() on null error after upgrading from Laravel 8 to Laravel 10
I recently upgraded my Laravel project from Laravel 8 to Laravel 10 and Laratrust 7 to Laratrust 8.5. After the upgrade, I encountered an issue when using the isAbleTo() method from Laratrust. The ...
0
votes
2
answers
69
views
Passing role type to Laratrust form database variable
I am using Laratrust with laravel to display records from the database according to roles. Every record has a role type field (example to table below).
In my blade view, I want to display them as the ...
0
votes
1
answer
1k
views
Call to undefined method App\Models\User::attachRole() error
Call to undefined method App\Models\User::attachRole()
I'm absolute beginner with laravel
I'm using "laratrust" package when I'm trying to register it gives me this error and I don't know ...
1
vote
0
answers
1k
views
laravel advance role permission with groups and modules
I have implmeneted Laratrust which works just fine. traditionally a role is assigned to a
user, a user can have one or many roles and a role can have many permissions.
I'm working on a project where ...
0
votes
0
answers
81
views
Laravel composer is different at PROD
My app is running ok at DEV but in production, the command composer update is running on an error as follows:
Your requirements could not be resolved to an installable set of packages.
Problem 1
-...
0
votes
0
answers
366
views
Check Role using Laratrust
I get the problem when I try to check role from users table. In my case, the role user in the database is 'AdminForesell' with user ID = 9, but when I try to check it using dd(), the result is false, ...
0
votes
1
answer
131
views
LaravelTrust and LaravelAuthUI can't import role to database
I have a problem with LaraTrust $User->attachRole('user'), and Laravel Auth UI. I want to attach a role upon registering a new User. After the registering, I don't see any data in the roles table.
...
0
votes
1
answer
698
views
How can I assign roles in the Seeder
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
$this->call(LaratrustSeeder::class);...
0
votes
1
answer
972
views
How to filter User by role based on the called Model?
I'm using Laratrust to manage these roles:
Patient
Doctor
I've a class called User which is the main entity, then I have a specific class for each role: Patient and Doctor.
Problem
To retrieve a ...
0
votes
1
answer
934
views
Laratrust middleware and blade directives to check from Profile not auth()->user()
I am getting to know the Laravel framework, and in the test application I am using the santigarcor/laratrust package to implement Roles and permissions.
For the project, I assumed that a user may have ...
-1
votes
1
answer
121
views
how to call data from database to view by user_role laratrust
I use laratrust as my user role, in the user role there are 1 = superadministrator, 2 = administrator, 3 = perusahaan, then I want to display the names of existing perusahaan in my view, which means ...
2
votes
0
answers
935
views
Undefined methods with Auth() and Auth.php after using Laravel Breeze and LaraTrust
l just installed Laravel Breeze and Laratrust to make my multi auth feature. When I opened app\Http\Controllers\Auth\AuthenticatedSessionController.php, without even editing anything yet, Intelephense ...
0
votes
2
answers
9k
views
how to check if user has role or permission in blade laravel
I am working with Laravel 8 and I use Laratrust package for roles and permissions
i Use the following directives to check role or permission in blade view
@permission('add_user')
<a href="...
0
votes
1
answer
203
views
Adding condition status =1 to laratrust authetification using Laravel8
I'm using the Laratrust package to manage the authentification.
Now I'm trying to adding a new condition to autheticate.
The user should have the status=1 to login.
So I'm using the function ...