PHP code example of pratik-dabhi / laravel-firewall

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

    

pratik-dabhi / laravel-firewall example snippets


->withMiddleware(function (Middleware $middleware) {
    $middleware->alias([
        'firewall' => \PratikDabhi\Firewall\Middleware\Firewall::class,
    ]);
})

Route::middleware(['firewall'])->group(function () {
    Route::get('/', fn() => 'Protected Page');
});

Route::get('/firewall/dashboard', fn() => view('vendor.firewall.dashboard'));
Route::get('/firewall/logs', fn() => view('vendor.firewall.logs'));
bash
php artisan vendor:publish --tag="firewall-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="firewall-config"
bash
php artisan vendor:publish --tag="firewall-views"