Error Lumen 5.7 | A Facade Root Has Not Been Set

Chalid Ade Rahman
2 min readJan 20, 2020

--

A. The Problem

This error found when i want to get data from my local mysql database. I was register mysql configuration in folder config like this,

Picture 1. Registered mysql configuration in database.php file to simplify

Then i go controller and call data in my database. i got error message like this,

Picture 2. Using postman to retrieve data from database

B. How I Solve This

I’m search on Google than i got simple way to solve this problem. Just open file bootsrap/app.php, Then uncomment script this.

// $app->withFacades();
// $app->withEloquent();

Make sure you uncomment that script, like this

Picture 3. Uncomment withFacades()

By the way, i get this information from this link. You can find another way to solve this problem.

  1. https://stackoverflow.com/questions/35418810/eloquent-error-a-facade-root-has-not-been-set

--

--

Chalid Ade Rahman
Chalid Ade Rahman

Written by Chalid Ade Rahman

PHP Programmer | PT Electronic Data Interchange Indonesia | Question : chalidade@gmail.com

Responses (2)