PHP code example of adolfocuadros / renqo-client-acl

1. Go to this page and download the library: Download adolfocuadros/renqo-client-acl 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/ */

    

adolfocuadros / renqo-client-acl example snippets


'providers' = [
    //Otros Proveedores de servicio
    //
    Adolfocuadros\RenqoClientACL\AclServiceProvider::class,
],

//Server of Renqo ACL server
    'renqo_acl'     => 'http://url-to-renqo.com',
    'server_token'  => ''

...
$app->routeMiddleware([
    //Otros Middleware
    
    'acl' => Adolfocuadros\RenqoClientACL\Middleware\CheckAclMiddleware::class,
]);


//Antes de cargar las rutas
$app->configure('renqo_client_acl');
...

'guards' => [
        'web' => [
            'driver' => 'session',
            //'provider' => 'users',
            'provider' => 'renqo-acl'
        ],

        'api' => [
            'driver' => 'token',
            'provider' => 'users',
        ],
    ],
    
    //
    // Otras Configuraciones
    //
    
//Agregar un nuevo proveedor
'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\User::class,
        ],

        //RENQOACL
        'renqo-acl' => [
            'driver' => 'renqo',
        ],

        // 'users' => [
        //     'driver' => 'database',
        //     'table' => 'users',
        // ],
    ],

    public function boot()
    {
        $this->registerPolicies();

        \Auth::provider('renqo', function ($app, array $config) {
            return new \Adolfocuadros\RenqoClientACL\AuthUserProvider($config);
        });
    }

$app->post('usuarios', [
    'middleware' => 'acl:usuarios.store',
    'uses' => 'UsuarioController@store'
]);
cmd
php artisan vendor:publish --tag=config

vendor/adolfocuadros/client-auth/config/renqo_client_acl.php -> config/renqo_client_acl.php