PHP code example of amjdhsan / larascope

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

    

amjdhsan / larascope example snippets


// config/larascope.php
'dashboard' => [
    'middleware' => ['web', 'auth'],
],

// config/larascope.php

return [

    // Master switch — set to false to disable everything
    'enabled' => env('LARASCOPE_ENABLED', true),

    'database' => [
        'connection' => env('LARASCOPE_DB_CONNECTION', null),
        'table'      => env('LARASCOPE_DB_TABLE', 'larascope_request_logs'),
    ],

    // Middleware groups to auto-register the logging middleware into
    'middleware_groups' => ['web', 'api'],

    'dashboard' => [
        'enabled'    => env('LARASCOPE_DASHBOARD_ENABLED', true),
        'path'       => env('LARASCOPE_DASHBOARD_PATH', 'larascope'),
        'middleware' => ['web'],   // add 'auth' to restrict access
        'per_page'   => 25,
    ],

    'logging' => [
        '  'enabled'     => true,
        'retain_days' => 30,
    ],

];

'exclude_paths' => [
    'health',
    '_debugbar/*',
    'telescope/*',
    'horizon/*',
],

'exclude_methods' => ['OPTIONS'],

// routes/console.php (Laravel 11+)
Schedule::command('larascope:prune')->daily();
bash
php artisan migrate
bash
php artisan vendor:publish --tag=larascope-config
bash
php artisan larascope:prune