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
0
votes
2 answers

Spatie/Laravel-Permissions: Undefined method translationEnabled() error

I am working on Laravel project that is using the following libraries: Spatie/Laravel-Permissions Laravel-Backpack Base, Crud Laravel-Backpack/PermissionManager Every time, I try to create new role or permission from the admin interface, I get the…
tank
  • 319
  • 6
  • 15
0
votes
1 answer

Spatie laravel/permission - Modifying table and methods

I'm working with Laravel 5.6 and Spatie laravel-permission and I want to modify the model_has_roles so it can have an extra field named code. Now, i did that thing by modifying the migrations the library provides via the next command: php artisan…
enbermudas
  • 1,603
  • 4
  • 20
  • 42
0
votes
4 answers

Assigning the role while user registration

I am working in laravel and i am using the spatie permission package and I want to assign the different role for the user while registration I am using the radio button to get the role from a user such as editor ,writer,blogger how to I assign the…
ManojKiran A
  • 5,896
  • 4
  • 30
  • 43
0
votes
3 answers

Spatie/Laravel-Permissions: Dummy Data Error

I am using Laravel with spatie/laravel-permission package as described in this tutorial. However, when I'm trying to create the dummy data, it is returning the following error Spatie\Permission\Exceptions\RoleDoesNotExist : There is no role named…
user10108694
0
votes
2 answers

Laravel - Spatie permissions saying permission doesn't exist

I've got a FormRequest class set up that is doing public function authorize() { return Auth::user()->hasPermissionTo('can update users'); } however it is throwing an exception However in my database the permission definately exists Is there…
owenmelbz
  • 6,180
  • 16
  • 63
  • 113
0
votes
1 answer

Laravel 5.6 session timeout exception when using spatie permissions

I have been trying to redirect the user after session timeout, but when using spatie permissions package i cant get the TokenMismatchException for the session timeout, i always get UnauthorizedException. Here is my Exceptions/Handler.php…
Shile
  • 1,063
  • 3
  • 13
  • 30
0
votes
1 answer

Delete password edit field in spatie/laravel-permission

I'm using spatie/laravel-permission package for permission system. but I want to use it except for the password edit field. where could I have to modify to make it? other way, could I edit role without entering a password field?
JsWizard
  • 1,663
  • 3
  • 21
  • 48
0
votes
1 answer

laravel-permission: assignRole works in Tinker but not in application

See my AdministrationController.php below: namespace App\Http\Controllers; use Illuminate\Http\Request; use Spatie\Permission\Models\Role; use Spatie\Permission\Models\Permission; use Illuminate\Foundation\Auth\User; class…
-1
votes
1 answer

Spatie role plugin for Laravel + seed users with roles, doesn't assignRole

At laravel 9 I tried to seed users with role Spatie just procced everything without error, but in database relations between role and users didn't appear in model in table "model_has_role" I created role like $roleName = 'MyRole'; $guardName =…
-1
votes
2 answers

Spatie Laravel 9: send email notification to Users with roles

I got everything working in terms of sending emails and templating. Now I want to replace the static to: email@test.com with users' email with specific roles. I have this code written: public function envelope() { return new Envelope( …
Abdulrahman Mushref
  • 1,012
  • 2
  • 18
  • 40
-1
votes
1 answer

Cannot use `roles` method default of Laravel Permission Spatie

I install spatie/laravel-permission, but i cannot use role method default of spaite. In User model I was add HasRoles:
trannguyenhan
  • 134
  • 4
  • 11
-1
votes
1 answer

Call to undefined method App\User::hasRole()

I'm using spatie/laravel-permission to handle roles. I installed the package through composer did the migrations, and added the service provider in my config/app.php file, created some roles and everything fine, but when i'm going to use the blade…
Santiago Ramirez
  • 167
  • 1
  • 3
  • 14
-1
votes
1 answer

User Is Not Logged In using Multi Auth/Guard in Spatie

i'm try to using multi auth using Admin Guard and implement with Spatie, after login succes using the Admin Guard, then access the Group Middleware but i got an error 403 USER IS NOT LOGGED IN. this is my code : Admin Model :
Didik Ariyana
  • 39
  • 3
  • 8
-1
votes
2 answers

romove obj from query laravel obj['pivot']

my query, I'm using laravel permission spatie. because I need to show the data it's will return the same format. and don't need to show pivot. if you see, the pivot is into employes->user->roles->pivote public function index() { $resp =…
Carlos
  • 572
  • 1
  • 5
  • 13
-1
votes
1 answer

Spatie - Laravel Permission - Cannot install in laravel 8.x

Here is a error Log: Please Help me out! PS C:\xampp\htdocs\moviedb> composer require spatie/laravel-permission Using version ^3.17 for spatie/laravel-permission ./composer.json has been updated Loading composer repositories with package…
1 2 3
17
18