1
|
<?php
|
2
|
|
3
|
/** @var Factory $factory */
|
4
|
/** @var Faker $faker */
|
5
|
|
6
|
use App\Artefact;
|
7
|
use App\Category;
|
8
|
use Faker\Generator as Faker;
|
9
|
use Illuminate\Database\Eloquent\Factory;
|
10
|
|
11
|
$factory->define(Artefact::class, function ($faker) {
|
12
|
return [
|
13
|
'name' => $faker->opera,
|
14
|
'author' => $faker->name,
|
15
|
'made_in' => $faker->countryCode,
|
16
|
'publisher' => $faker->company,
|
17
|
'year' => rand(1800, 2020),
|
18
|
'pages' => rand(0, 2000),
|
19
|
'main_category_id' => factory(Category::class)->create()->id,
|
20
|
];
|
21
|
});
|