Last active
June 1, 2022 15:18
-
-
Save tiagofrancafernandes/8c3cdbbd7b391ef6cefa9a0d8d1af80d to your computer and use it in GitHub Desktop.
Extract Laravel core for use outside the framework
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// https://gist.github.com/tiagofrancafernandes/8c3cdbbd7b391ef6cefa9a0d8d1af80d | |
/*-------- START LARAVEL OUTSIDE ---------*/ | |
/* | |
To use Laravel core without then | |
If you whant to use core by CLI without artisan | |
*/ | |
require_once __DIR__.'/../../vendor/autoload.php';//Full path to file maybe need to change | |
$app = require_once __DIR__.'/../../bootstrap/app.php';//Full path to file maybe need to change | |
$app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Using core.php | |
*/ | |
require_once __DIR__ . '/core.php'; | |
//dd(config('app.name')) | |
//dd(config('app.env')) | |
dump(\Illuminate\Foundation\Inspiring::quote()); | |
dump(\App\Models\User::count()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment