PHP code example of aplr / laravel-bouncer

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

    

aplr / laravel-bouncer example snippets


protected $middlewareGroups = [
    'web' => [
       // ...
    ],

    'api' => [
        // ...
        \Aplr\Bouncer\Bounce::class,
    ],
];

use Aplr\Bodybuilder\Facades\Bouncer;

$key = Bouncer::createKey('My App');

$valid = Bouncer::check('ZKEpwUSii5yvWt1xgLwHd8yguQGBZtrSi39hXFFd');