PHP code example of delboy1978uk / bone-firewall

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

    

delboy1978uk / bone-firewall example snippets




// use statements here
use Bone\Firewall\Firewall\FirewallPackage;

return [
    'packages' => [
        // packages here...,
        FirewallPackage::class,
    ],
    // ...
];



return [
    'blockedRoutes' => [
        '/user/register',
        '/user/lost-password/{email}',
    ],
];

return [
    'blockedRoutes' => [
        // etc
    ],
    'routeMiddleware' => [
        '/api/some/endpoint' => SomeMiddleware::class,
        '/api/another/endpoint' => new AwesomeMiddleware(),
        '/api/yet/another/endpoint' => [
            new AwesomeMiddleware(),
            SomeMidlleware::class,
        ],
    ],
];