PHP code example of oxhq / drove-laravel

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

    

oxhq / drove-laravel example snippets


use Drove\Laravel\LaravelRuntime;

$runtime = LaravelRuntime::boot($projectRoot);
$context = $runtime->scopeContext();

use App\Providers\AppServiceProvider;
use Drove\Laravel\DroveLaravelServiceProvider;
use Illuminate\Foundation\Application;

use function Drove\Laravel\laravel;

laravel(
    $projectRoot,
    ['driver' => 'sqlite-memory', 'prepared_schema' => true],
    [
        AppServiceProvider::class,
        DroveLaravelServiceProvider::class,
    ],
    static function (Application $app): void {
        // Migrate or seed the prepared parent state exactly once.
    },
);

$runtime->assertPlanSupported($scopeIr);
$runtime->bindTestCase($testCase, $context); // no-op for non-Laravel cases
$runtime->beforeDispatch($context, $tasks);
$runtime->enterDescendant($context, $task);
$runtime->leaveDescendant($context, $task);
$runtime->afterDispatch($context, $tasks);