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

Retrieve List of Roles related to User using spatie/laravel-fractal, Permissions works perfectly

I followed this topic on getting list of roles and permissions through user model using spatie/laravel-permission but none are engaging on my kind of concern. Want to retrieve list of roles related to user using spatie/laravel-fractal through…
0
votes
2 answers

Laravel Spatie middleware using role OR permission

I am using Laravel Spatie package and I have inserted all the permissions that I want and an Admin Role. What I am trying to do: I am trying to check in each route whether user is an admin (can do ANYTHING) or not an admin and has a certain…
AE1995
  • 372
  • 5
  • 17
0
votes
1 answer

Laravel Policy with Spatie Permission check gives 403 for client credentials API request

I'm using Laravel Policy and checking for permissions created using Spatie's Laravel-Permissions package. For an API call with client credentials, the authorizeResource() in the Controller constructor returns 403. If this is removed, it returns the…
Vaibhav Rathore
  • 301
  • 2
  • 10
0
votes
1 answer

Spatie Permissions for Laravel spark resource

We are developing an application using larval spark A user will be able to invited to multiple teams. With in each team there are a number of venues, we want each user to have specific permissions for that venue. I.E User will have the…
JaChNo
  • 1,493
  • 9
  • 28
  • 56
0
votes
2 answers

Duplicated value in my JSON response in Laravel

I created method show() in controller to return name and timestamps + all permissions this role has. Spatie/Laravel-Permission is responsible for associating users with permissions and roles in my API. public function show($name) { …
Artur Nawrot
  • 473
  • 1
  • 8
  • 19
0
votes
1 answer

belongsToMany error in laravel spatie permission?

My code is working 1 year ago, but now i got an error when i update my composer. I used laravel package from laravel-spatie. "spatie/laravel-permission": from 1.16.1 updated to 1.3.0, laravel version : laravel 5.2 FatalThrowableError in…
Ariel Pepito
  • 619
  • 4
  • 13
0
votes
0 answers

Cannot restrict access to permission manager routes using role-based middleware

PHP 7.3 Laravel 5.8 Laravel Backpack 3.6 I am trying to use the middlware 'role:admin' within my routes/backpack/permissionmanager.php file, to restrict access to the User, Roles and Permissions areas of Backpack to a subset of users with certain…
roberttolton
  • 111
  • 7
0
votes
1 answer

Laravel Nova User field with role

I am fairly new to Nova, but have used php for years etc. In an application I am building I have a relationship table set up which has the following fields in the Nova Resource…
AceWebDesign
  • 579
  • 2
  • 11
0
votes
1 answer

Laravel 5.6 - User Roles and Permissions (ACL) using Spatie Tutorial

Can you give me advice what to do. I am following this tutorial: Laravel 5.6 - User Roles and Permissions (ACL) using Spatie Tutorial All good. But in the end, I have only access to users page and cannot create new user because there are not roles…
Hristian Yordanov
  • 650
  • 1
  • 6
  • 25
0
votes
1 answer

Student should have a class and get it by a method

I have temporary problem with my project. I am creating a School Management System in Laravel. I have also implemented “spatie/laravel-permission”. I have some roles: Student, Teacher, Parent, Headmaster etc. I have some permissions: Add Grade /…
Tomek Greber
  • 5
  • 1
  • 7
0
votes
2 answers

How can i assign user-list permission to other roles also in laravel for spatie package(ACL Management)?

I am using Spatie package for ACL Management in Laravel and its working perfectly but i want to ask one question.If i have to assign user-list permission to any role like Manager even it has permission then it generates an error. and what is the…
hu7sy
  • 983
  • 1
  • 13
  • 47
0
votes
1 answer

Laravel giving error in foreach loop in spatie-permission

I was applying Spatie Laravel-permissions and coding to add permissions to roles. and faced a error. public function store(Request $request) { //Validate name and permissions field $this->validate($request, [ …
0
votes
1 answer

How to check policy for each results when user requested for deleting multiple records in laravel?

I have a method bulk_destroy in the controller that accepts an array of ids that user wants to delete. I've to check for each record whether the user is the owner of that record or he has the specific role to delete that record. At the end I've to…
0
votes
2 answers

Laravel and spatie/laravel-permission - plucking names of roles to a view

I want in Laravel to "pluck" to the view names of roles, each in different badge. My code: {{ $user->roles()->pluck('name')->implode(' ') }} My result: I am getting all role names in one span…
Tomek Greber
  • 5
  • 1
  • 7
0
votes
1 answer

How can I use UUID in spatie/laravel-permission

I'm using ramsey/uuid as primary key for all of my project tables. How can I disable auto-increment and allow roles and permissions primary key to be fillable? I have managed to do it on other tables but I'm stuck with these two.
antweny
  • 67
  • 2
  • 10