WouterJEloquentBundle icon indicating copy to clipboard operation
WouterJEloquentBundle copied to clipboard

"A facade root has not been set."

Open mariano-gomez opened this issue 6 years ago • 1 comments

I'm having this error message when i execute ./bin/console eloquent:seed

in my eloquent config file i have this:

wouterj_eloquent:
# ...
    eloquent: true
    aliases:
      db: true

And my DatabaseSeeder File looks like this:

namespace App\Seed;

use WouterJ\EloquentBundle\Seeder;
use Illuminate\Support\Facades\DB;

class DatabaseSeeder extends Seeder {
    public function run() {
        for ($i = 1; $i<=10; $i++) {
            DB::table('juego')->insert([
                'id' => $i,
                'secret' => 'secret' . $i,
                'name' => 'cliente' . $i,
            ]);
        }
    }
}

What am i missing here?

mariano-gomez avatar Apr 15 '18 18:04 mariano-gomez

The problem here is that you are using Illuminate\Support\Facades\DB instead of WouterJ\EloquentBundle\Facade\Db.

jomisacu avatar Jan 30 '22 21:01 jomisacu