I was working on my Laravel project and suddenly got this error:
In Facade.php line 258:
A facade root has not been set.
My last command is php artisan make:migration ...
It ran successfully
Here is the file causing the exception
vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php
if (! $instance) {
throw new RuntimeException('A facade root has not been set.'); // Here
}
I tried deleting the vendor
folder and running composer install
. It didn't help.
- PHP 8.0.13
- Laravel 8.73.2
Packages being used:
"require": {
"php": "^8.0",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"lanin/laravel-api-debugger": "^4.0", //
"laravel/framework": "^8.65",
"laravel/sanctum": "^2.11",
"laravel/tinker": "^2.5",
"laravel/ui": "^3.3",
"nwidart/laravel-modules": "^8.2", //
"spatie/laravel-permission": "^5.4", //
"stancl/tenancy": "^3.4" //
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.6", //
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^5.10",
"phpunit/phpunit": "^9.5.10"
},