Uncaught RuntimeException: A facade root has not been set in Laravel

596 Views Asked by At

I'am getting below error:

[Fri Aug 18 14:31:50 2023] PHP Fatal error: Uncaught RuntimeException: A facade root has not been set. in /home/..../vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:258

Laravel version is 8 and PHP version is 8

I have tried below commands too:

composer dump-autoload
composer update
php artisan config:clear
1

There are 1 best solutions below

2
Smily CK On BEST ANSWER

i got the answer guys, change on public/index.php file

$app = require_once __DIR__.'/bootstrap/app.php';

this to

$app = require_once __DIR__.'/../bootstrap/app.php';

slash is problem