PHP code example of jalallinux / laravel-shield

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

    

jalallinux / laravel-shield example snippets


// Use on your routes.
Route::get('/', ['middleware' => 'shield'], function () {
    // Your protected page.
});

// Use it within your controller constructor.
$this->middleware('shield');

// Use specific user credentials.
$this->middleware('shield:jalallinux');

'shield' => \JalalLinuX\Shield\ShieldMiddleware::class,

Route::get('/', ['middleware' => 'shield'], function () {
    // Your protected page.
});

$this->middleware('shield');

$this->middleware('shield:jalallinux');
bash
php artisan vendor:publish --provider JalalLinuX\\Shield\\ShieldServiceProvider
sh
php -r "echo password_hash('my-secret-passphrase', PASSWORD_DEFAULT);"