PHP code example of hanson / speedy

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

    

hanson / speedy example snippets


// config/speedy.php
return [
    'class' => [
        'namespace' => 'App\\Models\\',
        'model' => [
            'role' => 'Role',
            'user' => 'User',
            'permission' => 'Permission',
            'permission_role' => 'PermissionRole',
        ]
    ],

    'table' => [
        'role' => 'role',
        'permission' => 'permission',
        'user' => 'users',
        'permission_role' => 'permission_role',
    ],
    // ...
]

protected $permissionName;

public function __construct()
{
    $this->middleware('speedy.auth:' . $this->permissionName);
}