develop
Last change
on this file since e6c1f87 was e6c1f87, checked in by beratkjufliju <kufliju@…>, 3 years ago |
added pagination, is_important
|
-
Property mode
set to
100644
|
File size:
1005 bytes
|
Rev | Line | |
---|
[e6c1f87] | 1 | <?php
|
---|
| 2 |
|
---|
| 3 | namespace Database\Factories;
|
---|
| 4 |
|
---|
| 5 | use App\Models\Department;
|
---|
| 6 | use App\Models\Document;
|
---|
| 7 | use Carbon\Carbon;
|
---|
| 8 | use Illuminate\Database\Eloquent\Factories\Factory;
|
---|
| 9 | use Illuminate\Support\Facades\Storage;
|
---|
| 10 |
|
---|
| 11 | class DocumentFactory extends Factory
|
---|
| 12 | {
|
---|
| 13 | /**
|
---|
| 14 | * The name of the factory's corresponding model.
|
---|
| 15 | *
|
---|
| 16 | * @var string
|
---|
| 17 | */
|
---|
| 18 | protected $model = Document::class;
|
---|
| 19 |
|
---|
| 20 | /**
|
---|
| 21 | * Define the model's default state.
|
---|
| 22 | *
|
---|
| 23 | * @return array
|
---|
| 24 | */
|
---|
| 25 | public function definition()
|
---|
| 26 | {
|
---|
| 27 |
|
---|
| 28 | $deptID = $this->faker->numberBetween('1', '25');
|
---|
| 29 |
|
---|
| 30 | return [
|
---|
| 31 | 'arch_id' => $deptID . "/" . $this->faker->unique()->randomNumber(),
|
---|
| 32 | 'name' => $this->faker->unique()->firstName(),
|
---|
| 33 | 'description' => $this->faker->realText(),
|
---|
| 34 | 'user_id' => $this->faker->numberBetween('1', '2'),
|
---|
| 35 | 'department_id' => $deptID,
|
---|
| 36 | 'is_important' => $this->faker->boolean,
|
---|
| 37 | 'created_at' => $this->faker->dateTime()
|
---|
| 38 | ];
|
---|
| 39 |
|
---|
| 40 | }
|
---|
| 41 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.