I am aware of how to set up Package Migrations on Laravel 4 (using --bench="vendor/package" / --package="vendor/package").
But I can't seem to work out how to set up seeds for those migrations?
-- To clarify - I am aware of how to use the seeder, what I need to know is how to setup up a seed file for a standalone package? You can give a package separate migrations...
You can use the Seeder class like in app folder.
Database Seeding in Laravel 4
For exemple :
<?php
use Illuminate\Database\Seeder;
use Page;
class MySeeder extends Seeder {
public function run()
{
Page::create(array('title' => 'Foo-Bar !'));
}
}
and specify " --class " arg in :
$ php artisan db:seed --class="MySeeder"
Take care to make your class loaded by composer :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With