PHP code example of wamesk / laravel-telescope-dashboard

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

    

wamesk / laravel-telescope-dashboard example snippets


return [
    // Enable or disable the dashboard
    'enabled' => env('TELESCOPE_DASHBOARD_ENABLED', true),

    // URL path for the dashboard
    'path' => env('TELESCOPE_DASHBOARD_PATH', 'telescope-dashboard'),

    // Laravel gate used for authorization
    'gate' => env('TELESCOPE_DASHBOARD_GATE', 'viewTelescope'),

    // Database connection for telescope data
    'connection' => env('DB_CONNECTION_TELESCOPE', 'mysql_telescope'),

    // Default number of entries per page
    'per_page' => 50,

    // Maximum entries per page (security limit)
    'max_per_page' => 200,

    // Route group patterns for request filtering
    'route_groups' => [
        'api'      => '/api/v*',
        'nova-api' => '/nova-api/*',
        'web'      => '/*',
    ],

    // Path to original Telescope (for "View in Telescope" links)
    'telescope_path' => env('TELESCOPE_PATH', 'telescope'),

    // Middleware applied to all dashboard routes
    'middleware' => ['web', 'auth'],
];

Gate::define('viewTelescope', function ($user) {
    return in_array($user->email, [
        '[email protected]',
    ]);
});

return [
    // Incoming requests (Telescope stores the path + query string)
    'request' => [
        'GET /api/v1/location/autocomplete' => 'PostLocationAutocomplete',
        'GET /api/v1/location/{placeId}' => 'GetLocationPoint',
        'POST /api/v1/point/{pod}/meter/{sn}/deduction' => 'PostDeductionCreate',
    ],

    // Outgoing HTTP client requests (Telescope stores the full URL)
    'client_request' => [
        'GET */api/v1/pods/{podNumber}/meters' => 'Billien7.getPodMeters',
        'POST */api/v1/pods' => 'Billien7.getPointsOfDeliveryDetail',
    ],
];

  // routes/console.php
  Schedule::command('telescope-dashboard:sync-api-types')->hourly();
  

// config/wame-telescope-dashboard.php
'api_types' => [
    'provider' => ConfigApiTypeProvider::class,
    'config_key' => 'telescope-api-types',
    'sync_after_migrate' => env('TELESCOPE_DASHBOARD_API_TYPES_SYNC_AFTER_MIGRATE', true),
    'sync_queue' => [
        'connection' => env('TELESCOPE_DASHBOARD_API_TYPES_SYNC_CONNECTION'),
        'queue' => env('TELESCOPE_DASHBOARD_API_TYPES_SYNC_QUEUE'),
    ],
    'sync_chunk' => 1000,
    'cache_store' => null,
    'lock_wait_timeout' => env('TELESCOPE_STORE_LOCK_WAIT_TIMEOUT', 5), // 0 or false = server default
],

// config/wame-telescope-dashboard.php
'api_types' => [
    'provider' => App\Telescope\OpenApiTypeProvider::class,
    'config_key' => 'telescope-api-types',
],
bash
php artisan vendor:publish --tag=telescope-dashboard-assets
bash
php artisan migrate
bash
php artisan vendor:publish --tag=telescope-dashboard-config
bash
php artisan vendor:publish --tag=telescope-dashboard-assets --force
bash
php artisan vendor:publish --tag=telescope-dashboard-translations