PHP code example of starfolksoftware / persona

1. Go to this page and download the library: Download starfolksoftware/persona 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/ */

    

starfolksoftware / persona example snippets


return [
    'roles' => [
        // 'owner' => [
        //     'key' => 'owner',
        //     'name' => 'Owner',
        //     'permissions' => ['*'],
        // ],
    ],
];

use StarfolkSoftware\Persona\HasRole;

class User extends Authenticatable
{
    use HasRole;

    // ...
}

return [
    'roles' => [
        'owner' => [
            'key' => 'owner', // must be unique
            'name' => 'Owner',
            'permissions' => ['*'],
        ],
    ],
];

$user->hasPermission('post:edit');
bash
php artisan vendor:publish --tag="persona-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="persona-config"