This seems to be an issue with latest updates related to
Move database folder to different location
Hello
I am trying to move DatabaseSeeder class and the whole database folder to another location, which is a folder xxx in root
So i will have
xxx/database/factories
xxx/database/migrations
xxx/database/seeds
I moved the files, also changed few lines in composer like
"autoload-dev": {
"classmap": [
"tests/",
"xxx/database/"
]
},
I also override the application before init-ing it in bootstrap/app.php like
public function path()
{
return $this->basePath.DIRECTORY_SEPARATOR.'xxx';
}
public function databasePath()
{
return $this->path().'/database';
}
I made the migrations, factories and the seed, everything was running smooth. Today i decided to update the composer, and after that when trying to run the seeder, I am getting
Fatal error: Cannot redeclare class DatabaseSeeder in /Users/***/Documents/MAMP/lumen/xxx/database/seeds/DatabaseSeeder.php on line 36
after digging little bit, found out that the second include of this class is somewhere deep in the factory, because
public function run()
{
DB::statement('SET FOREIGN_KEY_CHECKS = 0');
// Truncate all tables
XXX\Page::truncate();
// Generate fake data for all models needed
factory(XXX\Page::class, 10)->create();
}
when I remove the factory helper call line, everything runs smooth again, so I am guessing something changed there in core, seems some include_once is changed to include or smth like this. Anyone has any idea on this ?
Please or to participate in this conversation.