PHP code example of lauroguedes / laravel-demo-mode

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

    

lauroguedes / laravel-demo-mode example snippets


// config/demo.php
'environments'  => ['demo'],
'allowed_hosts' => ['demo.example.com'],

use LauroGuedes\DemoMode\Facades\Demo;

Demo::enabled();        // the single point of truth
Demo::nextResetAt();    // derived from the cron, so a countdown cannot lie
Demo::credentials();    // what the login form should prefill
Demo::toArray();        // one payload for Blade, Livewire and Inertia

'on_demand' => ['enabled' => true],

'sandbox' => ['driver' => 'scoped'],
dotenv
DEMO_MODE=true
DEMO_RESET_SCHEDULE="0 */6 * * *"
bash
php artisan demo:doctor