I have seeder classes that I confirmed they could run individually, and I'm trying to run them from another seeder class in the same namespace.
I'm getting an error saying that the class run from another seeder is not found.
I'm using OctboerCMS build 419.
Seeder Class calling subseeder
<?php namespace Cocci\Custom\Updates;
use Seeder;
class SeedTablesCocciPedale extends Seeder
{
public function run()
{
$this->call('Cocci\Custom\Updates\SeedTablesCocciBike005');
$this->call('Cocci\Custom\Updates\SeedTablesCocciColor');
// $this->call(SeedTablesCocciBike005::class);
// $this->call(SeedTablesCocciColors::class);
}
}
Seeder called by another seeder
<?php namespace Cocci\Custom\Updates;
use Seeder;
use Cocci\Custom\Models\Product;
use Cocci\Custom\Models\Part;
use Cocci\Custom\Models\PreviewType;
use Cocci\Custom\Models\PartType;
use Cocci\Custom\Models\PartPreviewPosition;
class SeedTablesCocciBike005 extends Seeder
{
public function run()
{
$partTypeSetAll = PartType::create([
'name' => 'set_all',
'category' => PartType::CAT_ALL_PARTS,
]);
$partTypeNoPaintParts = PartType::create([
'name' => 'no_paint_parts',
'category' => PartType::CAT_NON_CUSTOMIZABLE,
]);
...
}
}
Error
% php artisan plugin:refresh Cocci.Custom
Rolled back: Cocci.Custom
Reinstalling plugin...
PHP Fatal error: Class 'Cocci\Custom\Updates\SeedTablesCocciBike005' not found in /Library/WebServer/Documents/cocci-custom/vendor/laravel/framework/src/Illuminate/Database/Seeder.php on line 62
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Cocci\Custom\Updates\SeedTablesCocciBike005' not found
I tried both ways specifying the class by string of fully qualified name and with class
keyword, but neither worked. Probably these seeder classes are not loaded?
What should I do?
Thanks in advance.