Download the PHP package wijzijnweb/laravel-inertia-permissions without Composer
On this page you can find all versions of the php package wijzijnweb/laravel-inertia-permissions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wijzijnweb/laravel-inertia-permissions
More information about wijzijnweb/laravel-inertia-permissions
Files in wijzijnweb/laravel-inertia-permissions
Package laravel-inertia-permissions
Short Description Easy to use package to implement Spatie's Permissions package into Inertia Laravel projects.
License MIT
Homepage https://github.com/wijzijnweb/laravel-inertia-permissions
Informations about the package laravel-inertia-permissions
Implementing Spatie's Permissions package into Inertia Laravel project.
Easy to use package to implement Spatie's Permissions package into Inertia Laravel project. The package also includes a Vue components to display and edit the roles of the current user and to manage roles and permissions.
Installation
You can install the package via composer:
You can publish and run the migrations with
Add the following to your vite.config.js file
Optionally, you can add the following to your jsconfig.json file:
//: # () //: # ()
Usage
Permissions and Roles are automatically Shared with Inertia. You can access them in your Vue components like this:
You can also use the directives to hide specific elements. To that you need to register the directives in your app.js file:
After that you can use the directives in your Vue components: You can use the pipe symbol and the ampersand to check for multiple roles or permissions:
There is also a component to prevent the user from seeing something with a feedback message:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.