Questions tagged [entrust]

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

115 questions
0
votes
1 answer

Laravel 5.3 with Entrust- always redirecting to home page except auth pages

Its about 13 hours I am trying to solve this issue, but no luck. I have setup Laravel 5.3 with Entrust. It was working fine. I have set a condition in the Controller to check whether the user has permission to the page s/he is trying to access. If…
Sadat
  • 3,493
  • 2
  • 30
  • 45
0
votes
0 answers

phpunit ErrorException: Trying to get property of non-object (Laravel/Entrust project)

When I run phpunit on my Laravel based project I get an error: ErrorException: Trying to get property of non-object But only on phpunit, the page renders fine. This is the line of code in my blade template that is de cause of the error: {{…
Laemol
  • 251
  • 2
  • 4
0
votes
2 answers

laravel class memcached not found

First of all , I have looked at all of these : #1 , #2 , #3 and none of them is my case nor has really a soloution. The problem is that I am developing a website by laravel 5.3.18 and here is the PHP info running on my server: PHP 7.0.9-2 (cli) (…
M.Shahrokhi
  • 385
  • 1
  • 7
  • 19
0
votes
1 answer

Request goes to each middleware laravel 5.2

I'm using laravel 5.2 with entrust/zizaco. When the user authenticates, they have the role admin, but when I put dd(1) in my app_user role middleware the request enters it !! The request also enters admin, and business_owner role middlewares. And…
0
votes
1 answer

Laravel Entrust -> get all Permissions for a role?

Is it possible to get all permissions which are assigned to a specific role? Because in my Role and Permission Models are no relations defined and I don't know if its safe to add them by myself.
xTheWolf
  • 1,756
  • 4
  • 18
  • 43
0
votes
2 answers

Getting relating model attributes to populate multi-select

I'm using Laravel 5.3, Entrust for permissions, LaravelCollective for Form functionality and Chosen for to manipulate the select boxes. I've bound my form to a model and my form is populating correctly, however I'm struggling to populate the multi…
SGouws
  • 321
  • 1
  • 12
0
votes
1 answer

How to access Role-based Controller and view using entrust

I'm new in laravel.I am using entrust Roles and permission which is working fine, but now I need to add every role like admin has his own controller and view. Superadmin should have his own controller and view. Can anyone please help me? How to…
Asad Javed
  • 29
  • 7
0
votes
1 answer

Laravel 5.2 Entrust: redirect user if he manually adds restricted URL

With Entrust, I implemented how user will be redirected to his own dashboard after login by adding this method in Authcontroller.php protected function authenticated() { if(\Auth::user()->hasRole(['super_admin',]) ) { return…
Tarunn
  • 1,038
  • 3
  • 23
  • 45
0
votes
1 answer

Specific role relations

I work on one project with Laravel 5.2 and Entrust package for ACL. In this project I need for one Role ('venue_owner') in which venue is owner. I have also table called venue and I have no idea how to make this relations, because table users is…
Kikolce
  • 181
  • 1
  • 1
  • 8
0
votes
1 answer

Cannot add foreign key constraint - Laravel Entrust

I really don't know what is wrong, but I cannot add foreign key constraint with this query. alter table `__acc_role_user` add constraint `__acc_role_user_user_id_foreign` foreign key (`user_id`) references `__acc_accounts` (`account_id`) on delete…
Narkon
  • 398
  • 2
  • 17
0
votes
1 answer

Granting registration page access to admin only

I need to grant the ability of new user creation to admin only. Intuitively, I've tried to restrict access to the getRegister and postRegister actions (which are located in AuthenticatesAndRegistersUsers trait used in AuthController) using Entrust…
Alex Lomia
  • 6,705
  • 12
  • 53
  • 87
0
votes
1 answer

laravel 5.1 admin role in middleware using Entrust

I am trying to filter route using 'auth' and 'auth.admin' middleware which should be like laravel 4.2's Route::filter. But it's not working. Here is my route Route::group(['prefix' => 'admin', 'middleware' => ['auth', 'auth.admin']], function() { …
0
votes
2 answers

laravel 5.2 entrust - show roles foreach user

My controller is public function index() { $users = User::paginate(15); return view('dash.users.index')->with(array('users' => $users)); } in view i pass: {{ $item->roles }} and return all column as array, if i put {{…
user0111001101
  • 187
  • 2
  • 4
  • 11
0
votes
1 answer

How to check if user owns a record with Entrust?

I want to allow users to CRUD only posts they own. I would like not to create a new middleware, but to leverage the existing ones instead. So, Can Entrust's default middlewares be extended to fit this purpose? class PostsController extends…
Alex Lomia
  • 6,705
  • 12
  • 53
  • 87
0
votes
1 answer

How to fetch list of users with permission 'x' in zizaco entrust laravel?

I wanted to show list of users those are having permission 'x'. I am using zizaco/entrust plugin in laravel 5.1 for managing roles/permissions. I have setup roles and permissions already. Previously i was working with roles but change of specs i…
Kapil Verma
  • 178
  • 3
  • 17