PHP code example of queopius / sentinel

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

    

queopius / sentinel example snippets


->withMiddleware(function (Middleware $middleware): void {
    $middleware->alias([
        'sentinel.headers' => \Queopius\Sentinel\Http\Middleware\AddSecurityHeaders::class,
        'sentinel.https' => \Queopius\Sentinel\Http\Middleware\EnforceHttps::class,
    ]);

    // Optional global
    $middleware->append(\Queopius\Sentinel\Http\Middleware\EnforceHttps::class);
    $middleware->append(\Queopius\Sentinel\Http\Middleware\AddSecurityHeaders::class);
})

'ui' => [
  'enabled' => true,
  'path' => 'sentinel',
  'middleware' => ['web', 'auth'],
  '

Gate::define('viewSentinelDashboard', fn ($user) => $user->hasRole('super_admin'));

Gate::define('viewSentinelDashboard', fn ($user) => $user->can('sentinel.view'));

'csp_reports' => [
  'enabled' => true,
  'route_path' => 'sentinel/csp-reports',
  'store_database' => true,
]
bash
php artisan sentinel:install --with-views
bash
php artisan migrate
bash
php artisan sentinel:audit
bash
php artisan vendor:publish --tag=sentinel-config
php artisan vendor:publish --tag=sentinel-views
php artisan vendor:publish --tag=sentinel-migrations
bash
php artisan vendor:publish --tag=sentinel-views
bash
composer sentinel:install --with-views
php artisan migrate
php artisan sentinel:audit
php artisan sentinel:scan