Skip to content

cdebattista/laravel-permission-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Total Downloads Latest Stable Version License

⭐ Star on GitHub — it helps!

Table of content

Installation

Composer

composer require cdebattista/laravel-permission

Inertia

For now, support only Jetstream with Inertia.

php artisan permission:install inertia

npm install && npm run dev

php artisan migrate

How it works

Inertia

You can customize Actions, Models, Policies and Pages as your wishes.

PHP

In php code :

$user->hasPermissions(['view_user', 'view_group', 'view_permission']);

more details here

Protect your routes :

Route::group(['permissions' => ['administrator', 'create_user', 'view_user', 'edit_user', 'delete_user']], function (){
    Route::resource('users', Inertia\UserController::class)->except(['show']);
});

more details here

Vuejs

in VUE files :

this.HasPermissions(['view_user', 'view_group', 'view_permission'])

more details here

You can use directive v-can :

<div v-can="['view_user', 'view_group', 'view_permission']">...</div>

more details here

License

Laravel Permission is open-sourced software licensed under the MIT license.

Links

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published