PHP code example of humans / laravel-sandbox

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

    

humans / laravel-sandbox example snippets


Sandbox::register([
    \App\Sandbox\SalesDemo::class,
]);

use Auth;
use Humans\Sandbox\Contracts\RefreshDatabase;
use Humans\Sandbox\Sandbox;

class SalesDemo extends Sandbox implements RefreshDatabase
{
    public function run()
    {
        Auth::login(
             factory(\App\User::class)->create()
        );

        return redirect()->route('home');
    }
}
bash
php artisan sandbox:make SalesDemo