271 questions
1 vote
1 answer
45 views
Relational Attributes Missing After php artisan scout:import
Laravel Scout Meilisearch - Role, Creator, and Updater Attributes Missing After Import Environment: Laravel: 12.0 Scout: 10.13 Scout Driver: Meilisearch I'm using spatie/laravel-permissions for role ...
1 vote
0 answers
55 views
Laravel Blade @can Not Working, But in_array(Auth::user()->getAllPermissions()) Does
I am working on a Laravel 11 project using Spatie's Laravel Permission package for role-based access control. I have the following Blade template where I want to conditionally display a sidebar link ...
0 votes
1 answer
1k views
laravel 11 Target class [role] does not exist ( spatie/laravel-permission)
i am developing REST API laravel 11 app i installed spatie/laravel-permission and i can create a user and assign role successfully also on login i can capture token and role successfully but when i to ...
0 votes
1 answer
249 views
getRoleNames method as an accessor in user model. Spatie Laravel Permission
I am trying to create an accessor that will return the users role name. It is possible to access the getRoleNames() method in the User model? //User Model /** * The accessors to append to the ...
0 votes
0 answers
51 views
Managing "Reject" Button Access in a Laravel API App using Service and Policy
In my Laravel API project, I have a Service for handling quote rejection and a Policy for controlling access based on application type. Here's how I'm managing access to the "Reject" button ...
0 votes
1 answer
219 views
Spatie UUID model_has_role model_id return 0 when assignRole()
I'm trying to use UUID for spatie, and followed the instruction from official document. Everything went well until I have to assignRole to user. It return 0 Where it should have same value as role_id ...
0 votes
1 answer
40 views
Error When Update Mahasiswa Data : Unknown column 'id' in 'where clause'
I use protected $primaryKey = 'NIM'; public $incrementing = false; protected $keyType = 'string'; (In Mahasiswa Model) it's already fine when store/add data to database but when i want to update the ...
0 votes
1 answer
424 views
Spatie \ Permission \ Exceptions \ PermissionDoesNotExist
I was trying to use spatie role and permission but when i try to update role and permission it gives me the above error and highlights the if statement in the function below located inside the user ...
0 votes
1 answer
902 views
Setting up Spatie Permissions in laravel
I am facing an issue in setting up the Spite Permissions within my Laravel App I have followed the following guide https://medium.com/@miladev95/step-by-step-guide-to-user-role-and-permission-tutorial-...
0 votes
1 answer
395 views
403 USER IS NOT LOGGED IN IN Laravel Spatie
I am new in Laravel Spatie, and when I fixed some of the problems in my code one by one. When I redirect my view to a webpage (without the middleware route) I can freely access it, but when I do it ...
0 votes
1 answer
350 views
Implementing Dual-Level Roles in Laravel App
I'm currently developing an application using Laravel and have encountered a challenge with implementing a two-tier role system. I'm using the laravel-permission package but am struggling to configure ...
2 votes
1 answer
911 views
Restricting Laravel log viewer access to Administrators using Spatie Permissions
I'm using Spatie to manage permissions and installed a log-viewer to see logs. The problem is that everyone can see the logs in the address /log-viewer. I want only the administrator to have access to ...
1 vote
4 answers
4k views
Target class [Spatie\Permission\Middlewares\PermissionMiddleware] does not exist
I hope you’re all right. I was wondering if you could take a look at a problem I’ve encountered in a Laravel project that uses Spatie Laravel Permission. The mistake I’m facing is this: Target class [...
-1 votes
1 answer
2k views
How to assign only one role to the user using Spatie?
I'm working with the Spatie Laravel Permissions package and I want to assign just one role to a user. However, when i try to update the role of the user, rather then overwriting the assigned role, it ...
0 votes
1 answer
720 views
Spatie's wildcard permission or not?
I am currently building a job portal application using laravel 10.x. There will be two types of user roles who will be using the application: Employer Candidate For permissions, I am using [spatie's ...