konekt/concord
Laravel extension for building modular applications using conventions on top of service providers. Manage in-app and external modules with isolation-friendly structure, version compatibility across Laravel releases, and tooling around module registration and organization.
Seeders are just normal Laravel seeders. The default (recommended) folder for db seeds is <module_root>/resources/database/seeds
The only difference compared to seeders placed in your project's database/seeds folder is that app seeders use no namespace.
resources/database/seeds folder.Vendor\Module\Seeds."autoload": {
"psr-4": {
"Vendor\\Module\\": "src",
"Vendor\\Module\\Seeds\\": "src/resources/database/seeds"
}
}
Then you can either added the seeder to the main DatabaseSeeder's run method $this->call(\Vendor\Module\Seeds\YourSeeder::class) or invoke explicitly with artisan:
php artisan db:seed --class="\Vendor\Module\Seeds\YourSeeder"
resources/database/seeds folder.Vendor\Module\resources\database\seeds.Adding to app's main the seeder:
class DatabaseSeeder extends \Illuminate\Database\Seeder
{
public function run()
{
$this->call(\Vendor\Module\resources\database\seeds\YourSeeder::class);
}
}
Invoking with artisan:
php artisan db:seed --class="\Vendor\Module\resources\database\seeds\YourSeeder"
If you're sure you won't conflict with other seeders having the same name, then you can go without seeders having namespaces.
resources/database/seeds folder."autoload": {
"classmap": [
"src/resources/database/seeds"
],
"psr-4": {
"Vendor\\Module\\": "src"
}
}
Adding to DatabaseSeeder $this->call(YourSeeder::class);
Invoking explicitely with artisan:
php artisan db:seed --class=YourSeeder
Next: Models (Entities) »
How can I help you explore Laravel packages today?