phinx
phinx copied to clipboard
getDependencies() doesn't work nicely with namespaced seeders
Hey, I'm trying to get getDependencies() to work with namespaced seeders.
I have the following code:
<?php
namespace Database\Seeders;
use Phinx\Seed\AbstractSeed;
class CarSeed extends AbstractSeed{
public function run(){
$this->table('cars')
->insert([
[
'name' => 'Ford Mustang',
'color' => 'blue',
'garageId' => 1
]
->save();
}
public function getDependencies(){
return [
'Database\Seeders\GarageSeed'
];
}
}
And
<?php
namespace Database\Seeders;
use Phinx\Seed\AbstractSeed;
class GarageSeed extends AbstractSeed{
public function run(){
$this->table('garages')
->insert([
[
'name' => 'MyGarage'
]
->save();
}
}
If I try to run this I get the following error:
In Manager.php line 848:
Could not find class "GarageSeed" in file "/var/www/html/app/database/s
eeds/GarageSeed.php"
Is there any easy solution for this?
Maybe someone can help here?