Questions tagged [entrust]

Entrust is a plugin to add role-based permissions to Laravel.

115 questions
12
votes
4 answers

How to fix in laravel 5.2 zizaco entrust:migration class name validation?

I have followed zizac/entrust installation tutorial from GitHub Link and faced with error: Class name must be a valid object or a string in var/www/html/laravel_test/vendor/zizaco/entrust/src/commands/MigrationCommand.php on line…
Noproblem
  • 745
  • 1
  • 6
  • 15
8
votes
3 answers

Laravel 5.2 Entrust migrate error, cannot add foreign key constraints

I installed and configure the Laravel 5.2, its working fine, for User ACL I installed the zizaco/entrust package while running this command php artisan migrate (for creating roles, permissions table etc) getting following…
Qazi
  • 5,015
  • 8
  • 42
  • 62
7
votes
1 answer

Using a policy's this->authorize() check in a laravel controller inside a store() method

So I was reading about using laravel policies for granting authorities on the resources of my application but there seems to be a problem there though I followed the tutorial. I have a user model which can't be created via HTTP requests except by…
Ramy Farid
  • 144
  • 1
  • 2
  • 15
5
votes
1 answer

Check particular role's permission in Vue JS and Laravel 5.1 + Entrust

I am using Zizaco/entrust in Laravel 5.1. I want to explicitly give permissions to particular role by using checkboxes. This is my code: Fetching Roles: fetchRoles: function(){ this.$http.get('api/role',function(data){ …
sazanrjb
  • 138
  • 2
  • 8
4
votes
1 answer

Check If user has a role In Laravel 5.5

I'm using entrust package to manage roles and I have used passport for authentication since it is API's. Actually what I need is want to check user has a role, I have tried with below code but it doesn't work public function Adminlogin() { …
Manjunarth
  • 313
  • 2
  • 7
  • 22
4
votes
3 answers

Can Laravel Auth::attempt() handle relationships?

I'm using entrust for managing role based permissions in Laravel 5.3, and naturally using manual/custom logins for different user types. Is it possible for Auth::attempt() to handle foreign table relationships? Basically, I want to do something like…
A. Appleby
  • 469
  • 1
  • 10
  • 23
4
votes
1 answer

How to integrate role based permission in Laravel with Dingo API?

I'm currently studying Laravel framework and dingo api. Is there any way to integrate the role based permission using entrust to dingo api? So for example, I have a route to get all the list of users, but only admin can access this. So if the user…
A Mendoza
  • 101
  • 2
  • 10
4
votes
4 answers

Laravel 5.2.2 and Entrust error call to undefined method

When I am using latest Laravel 5.2.2 and Entrust ("zizaco/entrust": "5.2.x-dev") I face this error and not sure how to solve this: Call to undefined method Zizaco\Entrust\EntrustServiceProvider::hasRole() I tested this code on…
cyberfly
  • 5,568
  • 8
  • 50
  • 67
4
votes
3 answers

PHP Fatal error: Call to undefined method Illuminate\Foundation\Application::bindShared() in ..Entrust/EntrustServiceProvider.php on line 72

I've just installed Entrust to add Role-based Permissions to my application based on Laravel 5.2. But when I try to execute php artisan vendor:publish I get this error : PHP Fatal error: " Call to undefined method…
devma
  • 43
  • 1
  • 4
3
votes
1 answer

Entrust with Laravel - Eloquent queries with conditional roles

I'm having single User eloquent model in my Laravel App: I'll be using Entrust for roles. Users can have multiple roles. I already managed to get the User have multiple roles with same eloquent model User like this: public function company(){ …
Leap Hawk
  • 622
  • 1
  • 6
  • 25
3
votes
1 answer

Laravel 5 Entrust - Users belong to many apps

I am using Entrust package in Laravel 5.3 for managing user roles and permissions, and it works perfectly. The problem is that my users belong to many apps, so I need to check roles and permissions having into account in which app are they trying to…
andcl
  • 3,342
  • 7
  • 33
  • 61
3
votes
0 answers

Laravel Entrust Different Roles on Different Organizations

Is it possible to have different roles on different organizations for a user using Entrust https://github.com/Zizaco/entrust Entrust docs say you can have a user and attach roles to it. But what I would like is a user can belong to multiple…
Isaac Tweeklabs
  • 143
  • 1
  • 5
3
votes
1 answer

Laravel 5.2 with Entrust - not able to check Permission and render 403

I'm new to Laravel and I'm developing an application with User, Roles ans Permission. For this I'm using Zizaco/Entrust. I'm almost done with all of the steps but I'm not able to show the custom page for 403. My code are as follows : Permission :…
Pranab
  • 191
  • 1
  • 11
3
votes
4 answers

There are no commands defined in the "entrust" namespace

I'm using entrust for roles and I have to make the migrations, but when I want to execute php artisan entrust:migration I get this error [Symfony\Component\Console\Exception\CommandNotFoundException] There are no commands defined in the…
meluluji
  • 319
  • 1
  • 2
  • 15
3
votes
4 answers

Zizaco entrust does not create the entrust.php

Why the file entrust.php is not created when I run this: php artisan vendor:publish I'm following this config and this is my composer.json "zizaco/entrust": "5.2.x-dev" "You can also publish the configuration for this package to further customize…
meluluji
  • 319
  • 1
  • 2
  • 15
1
2 3 4 5 6 7 8