Support the ongoing development of Laravel.io →
Blade Architecture Authorization
Last updated by @ajax30 2 years ago.
0

You can have a look at https://spatie.be/docs/laravel-permission/v5/introduction and see how they did it. It's basically the same thing you are trying to do and I don't know why you try to reinvent the wheel.

Last updated by @geowrgetudor 2 years ago.
0
Blade::if('hasPermissionTo', function ($permission) {
    return in_array($permission, $this->user_permissions);
});
0
Solution selected by @ajax30

Sign in to participate in this thread!

Eventy

Your banner here too?

Razvan ajax30 Joined 2 Oct 2021

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.