57 lines
1.9 KiB
PHP
57 lines
1.9 KiB
PHP
<?php
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Model Factories
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here you may define all of your model factories. Model factories give
|
|
| you a convenient way to create models for testing and seeding your
|
|
| database. Just tell the factory how a default model should look.
|
|
|
|
|
*/
|
|
|
|
$factory->define(\XaiCorp\AbcParser\Models\Laravel5\Collection::class, function (Faker\Generator $faker) {
|
|
return [
|
|
'name' => $faker->name,
|
|
];
|
|
});
|
|
|
|
$factory->define(\XaiCorp\AbcParser\Models\Laravel5\Tune::class, function (Faker\Generator $faker) {
|
|
return [
|
|
'x_id' => $faker->numberBetween(1, 10),
|
|
];
|
|
});
|
|
|
|
$factory->define(\XaiCorp\AbcParser\Models\Laravel5\Person::class, function (Faker\Generator $faker) {
|
|
return [
|
|
'name' => $faker->name,
|
|
'email'=> $faker->safeEmail,
|
|
];
|
|
});
|
|
|
|
$factory->define(\XaiCorp\AbcParser\Models\Laravel5\TuneAttribute::class, function (Faker\Generator $faker) {
|
|
$types = \XaiCorp\AbcParser\Models\Laravel5\TuneAttribute::getTypes();
|
|
return [
|
|
'tune_id' => function () {
|
|
return factory(\XaiCorp\AbcParser\Models\Laravel5\Tune::class)->create()->id;
|
|
},
|
|
'type' => $types[random_int(0, count($types)-1)],
|
|
'string' => $faker->words(3, true),
|
|
'ordering' => $faker->numberBetween(1, 5),
|
|
];
|
|
});
|
|
|
|
|
|
$factory->define(\XaiCorp\AbcParser\Models\Laravel5\CollectionAttribute::class, function (Faker\Generator $faker) {
|
|
$types = \XaiCorp\AbcParser\Models\Laravel5\CollectionAttribute::getTypes();
|
|
return [
|
|
'collection_id' => function () {
|
|
return factory(\XaiCorp\AbcParser\Models\Laravel5\Collection::class)->create()->id;
|
|
},
|
|
'type' => $types[random_int(0, count($types)-1)],
|
|
'string' => $faker->words(3, true),
|
|
'ordering' => $faker->numberBetween(1, 5),
|
|
];
|
|
});
|