source: database/factories/DepartmentFactory.php@ d7aa044

develop
Last change on this file since d7aa044 was 4b7e2d3, checked in by beratkjufliju <kufliju@…>, 3 years ago

bug fixes, edited export, added fileSeeder for DB testing

  • Property mode set to 100644
File size: 1021 bytes
Line 
1<?php
2
3namespace Database\Factories;
4
5use App\Models\Department;
6use App\Models\Folder;
7use Carbon\Carbon;
8use Illuminate\Database\Eloquent\Factories\Factory;
9use Illuminate\Support\Facades\Storage;
10use function Sodium\increment;
11
12class DepartmentFactory extends Factory
13{
14 /**
15 * The name of the factory's corresponding model.
16 *
17 * @var string
18 */
19 protected $model = Department::class;
20
21 /**
22 * Define the model's default state.
23 *
24 * @return array
25 */
26 public function definition()
27 {
28 $location = $this->faker->unique()->numberBetween(10, 25);
29 Storage::disk('uploads')->makeDirectory('Departments/' . $location);
30 return [
31 'name' => "Department" . ' ' . $this->faker->unique()->firstName(),
32 'code' => $location,
33 'location' => 'Departments' . DIRECTORY_SEPARATOR . $location,
34 'no_of_folders' => 0,
35 'user_id' => "1",
36 'created_at' => $this->faker->dateTime()
37 ];
38 }
39}
Note: See TracBrowser for help on using the repository browser.