PHP code example of awema-pl / module-permission
1. Go to this page and download the library: Download awema-pl/module-permission library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
awema-pl / module-permission example snippets
'routes' => [
// roles routes prefixes (path & naming)
'roles_prefix' => 'roles',
'roles_name_prefix' => 'roles.',
// permissions routes prefixes
'permissions_prefix' => 'permissions',
'permissions_name_prefix' => 'permissions.',
]
Permission::routes();
# Routes for permissions management
'permissions.'
# Routes for roles management
'roles.'
use AwemaPL\Permission\Traits\HasRoles;
class User extends Authenticatable
{
use HasRoles;
}
bash
php artisan vendor:publish --provider="AwemaPL\Permission\PermissionServiceProvider" --tag="migrations"
bash
php artisan migrate
bash
php artisan vendor:publish --provider="AwemaPL\Permission\PermissionServiceProvider" --tag="views"
bash
php artisan db:seed --class="AwemaPL\Permission\Seeds\PermissionTablesSeeder"
bash
php artisan vendor:publish --provider="AwemaPL\Permission\PermissionServiceProvider" --tag="config"