Thanks to visit codestin.com
Credit goes to 3v4l.org

3v4l.org

run code in 500+ PHP versions simultaneously
<?php // 1. Locate and require the Composer autoloader require __DIR__ . '/../../../vendor/autoload.php'; // 2. Boot the Laravel application kernel $app = require_once __DIR__ . '/../../../bootstrap/app.php'; $kernel = $app->make(Illuminate\Contracts\Console\Kernel::class); $kernel->bootstrap(); // ========================================================================= // YOUR ELOQUENT CODE GOES HERE // ========================================================================= use App\Models\User; // Now you can use dd() and Eloquent perfectly! $users = User::where('is_active', true)->latest()->take(5)->get(); dd($users->toArray());
Output for 8.5.0 - 8.5.3
Warning: require(/in/../../../vendor/autoload.php): Failed to open stream: No such file or directory in /in/q0HIM on line 4 Fatal error: Uncaught Error: Failed opening required '/in/../../../vendor/autoload.php' (include_path='.:') in /in/q0HIM:4 Stack trace: #0 {main} thrown in /in/q0HIM on line 4
Process exited with code 255.
Output for 8.3.0 - 8.3.30, 8.4.1 - 8.4.18
Warning: require(): open_basedir restriction in effect. File(/in/../../../vendor/autoload.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/q0HIM on line 4 Warning: require(/in/../../../vendor/autoload.php): Failed to open stream: Operation not permitted in /in/q0HIM on line 4 Fatal error: Uncaught Error: Failed opening required '/in/../../../vendor/autoload.php' (include_path='.:') in /in/q0HIM:4 Stack trace: #0 {main} thrown in /in/q0HIM on line 4
Process exited with code 255.

preferences:
41.96 ms | 730 KiB | 4 Q