Questions tagged [laratrust]
29 questions
1
vote
0 answers
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 requirments are little changed, a role can have…

Wcan
- 840
- 1
- 10
- 31
1
vote
0 answers
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 throws an error:
``Undefined method…

ellajhonm
- 89
- 1
- 9
1
vote
1 answer
How is set different roles and add new role
Im using system where it is using $user->is_admin and $user->is_employee and $user->is_customer there is no column is_admin or is_employee or is_customer in database. I know that it takes it from user model. but is_admin or is_employee is not…

excel32323
- 25
- 3
1
vote
2 answers
Laratrust Middleware Admin Panel
Laratrust is now offering a panel where you can CRUD the roles and permissions. Works like a charm until I use 'permission:access-laratrust'(for example) as middleware in the configuration. For some odd reason it does not work. I dumped Auth::user()…

Dion
- 78
- 1
- 9
1
vote
1 answer
seeding table not sucess in Laravel 7 and Laratrust 6
using Laravel 7 and Laratrust 6 and need seeding the Table using the seed command but seeding only some tables only. not seeding following tables as well in the database users,role_user,permission_user
my DataBaseSeeder.php

sign458
- 55
- 8
1
vote
1 answer
User does not have any of the necessary access rights Error
I used Lara-trust to set roles and permissions:
This is DatabaseSeeder.php file in database directory:
public function run()
{
// $this->call(UsersTableSeeder::class);
$this->call([
LaratrustSeeder::class,
…

shaza
- 37
- 11
0
votes
0 answers
Laratrust is not saving data to database with Jetstream and Laravel 10
I am using Laravel 10 and Jetstream authentication for my project. I am trying to use the Laratrust for multi-authentication and roles. I have run all the commands of Laratrust but I am unable to understand where to add this $user->addRole($admin);…

Md Rejwan Mahmud
- 1
- 1
0
votes
1 answer
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 why
`

meory
- 1
0
votes
0 answers
Laratrust 6x- problems with db:seed
I need help about php artisan db:seed.
I installed Laratrust 5.2 for Laravel 7 and than i make upgrade from 5.2 to 6.
I follow this steps: https://laratrust.santigarcor.me/docs/6.x/upgrade.html;
This is how it works, everything is ok.
Later, I ran…

Dev__PosA
- 1
- 2
0
votes
0 answers
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
- mpdf/mpdf[v7.1.0, ..., v7.1.6] require php ^5.6…

Marcello Pato
- 500
- 6
- 21
0
votes
0 answers
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, this is wrong, because in the database is…

baihaqi
- 55
- 5
0
votes
1 answer
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.
protected function create(array $data)
{
return…
0
votes
1 answer
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);
}
}
How can I assign roles for the users that…

Mouise Bashir
- 11
- 2
0
votes
1 answer
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 list of users with the role of doctor I have to…

sfarzoso
- 1,356
- 2
- 24
- 65
0
votes
1 answer
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 several profiles (One To Many) with assigned…

devhubpl
- 11
- 4