1. Go to this page and download the library: Download hedronium/seed-cascade library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hedronium / seed-cascade example snippets
use Hedronium\SeedCascade\SeedCascade;
class DatabaseSeeder extends SeedCascade {
public $table = "food";
public function seedSheet() {
return [
'1-6' => [
'name' => 'Cabbage',
'type' => 'vegetable'
],
'4-6' => [
'name' => 'Carrot'
]
];
}
}
use Hedronium\SeedCascade\SeedCascade;
class DatabaseSeeder extends SeedCascade {
public $table = "fruits";
public function seedSheet() {
return [
'1-10' => [
'name' => 'Potao'
]
];
}
}
use Hedronium\SeedCascade\SeedCascade;
use App\Potato;
class DatabaseSeeder extends SeedCascade {
public $model = Potato::class;
public function seedSheet() {
// Return seeding definitions.
}
}