Questions tagged [laravel-permission]

Laravel permission is a 3rd party Laravel package developed by Spatie to manage user permissions and roles in a database.

Laravel permission is a 3rd party Laravel package to manage user permissions and roles in a database.

It is maintained by Spatie, a Belgian company that creates websites and web application. This is one of many Laravel packages they maintain.

It can be installed using composer via the following command:

composer require spatie/laravel-permission

Links:

261 questions
2
votes
1 answer

Laravel permissions : The super-admin bypass on auth provider doesn't work

I'm using spatie's laravel-permission package and created roles and permissions on my application and wrote a bypass for the super-admin role, as specified on their doc, in the AuthServiceProvider. It worked like a charm, and suddenly it stopped…
ABCrafty
  • 278
  • 1
  • 3
  • 16
2
votes
0 answers

How to make wrapper for spatie/laravel-permission Contracts/Permission?

In Laravel 8 app using spatie/laravel-permission ^3.18 I defined in bootstrap/app.php if ( ! defined("PERMISSION_USE_SERVICES")) { define("PERMISSION_USE_SERVICES", 'Use services'); } and in init seeder : $CustomerRole = Role::create(['name'…
mstdmstd
  • 2,195
  • 17
  • 63
  • 140
2
votes
1 answer

Laravel spatie/laravel-permission @can directive

I'm currently working with Spatie roles and permissions library. I have multiple guards which are admin and web. My admin have permission to 'manage authentication' with guard_name = admin. When I try to run the syntax below it return…
2
votes
3 answers

Spatie Laravel Permissions - How To Get Users that have one Role or another Role

I'm trying to figure out if there is a simple way to get all the users that have a role or another role. On the official documentation of Spatie Laravel Permissions, I couldn't find this. I'm trying like this but I get all the…
Davide Casiraghi
  • 15,591
  • 9
  • 34
  • 56
2
votes
0 answers

Can't create TCP/IP socket (10106) when trying to connect with spatie / laravel-backup

I'm using spatie/laravel-backup package in my laravel project When I want to backup via command line everything works fine via command php artisan backup:run or php artisan backup:run --only-db or php artisan backup:run --only-files But when I…
khalid J-A
  • 574
  • 1
  • 7
  • 19
2
votes
0 answers

Laravel Permission middleware returns 403 Forbidden always

I am using the laravel-permission extension from Spatie for managing user roles and permissions. I have configured users, roles and permissions and it is updated in the database correctly. Now I am trying to protect the routes using role middleware…
Happy Coder
  • 4,255
  • 13
  • 75
  • 152
2
votes
1 answer

Laravel Spatie Roles & Permissions: How to change default tables?

I am using Laravel Spatie Roles & Permissions and wish to change the default roles and permissions tables which power it. I am changing the table_names values in: \vendor\spatie\laravel-permission\config\permission.php The new…
rup
  • 483
  • 5
  • 15
2
votes
0 answers

Multiple guard assign rolling problem in laravel spatie permission

I am using laravel spatie permission package. I have three guard named... web api customer Problem There is no role named 'customer' I created a customer role with customer guard. auth.php 'defaults' => [ 'guard' => 'web', …
2
votes
3 answers

Adding and revoking permission to a specific user with a specific role

I am using this package https://github.com/spatie/laravel-permission for roles and permissions. In my application i have several roles like: Users Employers Shop owners Vendors Depending on the level of trust i want each person in a specific role…
Gandalf
  • 1
  • 29
  • 94
  • 165
2
votes
0 answers

Assigning user Roles on Nova using Spatie Laravel Permissions

I am currently using spatie laravel permissions package in a laravel 5.8 project and using Nova for admin. I want the super admin user to be able to assign a role to selected users from the nova dashboard. This is how I have attempted to do it, by…
Mena
  • 1,873
  • 6
  • 37
  • 77
2
votes
3 answers

How do I check User Role before Logging in A user with Spatie's Laravel-Permission?

I'm using Spatie's "Laravel Permission" Package for the ACL. Everything is working perfectly. I now want to allow only the User roles 2 and 3 to Login. Previously, before using "Laravel Permission" package I had only this "role" column on my table…
ask_alab
  • 59
  • 1
  • 1
  • 7
2
votes
1 answer

Laravel-Permission - permission not found in artisan list - There are no commands defined in the "permission" namespace

Hello Good Developers, I am using spatie:laravel-permissions package in my application. I have identical code in local machine and production server. I am having a strange issue with my production environment. I cannot find permission in list of…
Pankaj Jha
  • 886
  • 15
  • 37
2
votes
1 answer

Data tables column shift leftside after add condition using @can()

I am using yajra datatebles with HTML builder to show server side. Here I have to hide the delete button in the action column from a particular role. I am using spatie permission package and added @can() to hide the delete button. My code is given…
2
votes
1 answer

Laravel testing - UnauthorizedException: User does not have the right roles

So I'm working with laravel tests and I'm making tests for accessing users page where I can see all the users and edit them. In the UsersController.php i have made that only admin can access the user's page. The roles and permissions I've used from…
2
votes
1 answer

PermissionDoesNotExist (there is no permission with id 1) In spatie Permission Package Laravel 5.6

i am using the spatie permission package.I want to assign a permission to a role.Below Is my method in controller: public function testing_role_permission() { $role = Role::findById(2); $permission = Permission::findById(1); …
Mubeen Ali
  • 31
  • 2
  • 10
1 2
3
17 18