Changeset b9c4a92 for database


Ignore:
Timestamp:
10/18/21 23:00:23 (3 years ago)
Author:
Berat Kjufliju <kufliju@…>
Branches:
develop, master
Children:
ea7b12a
Parents:
e6c1f87
Message:

edited file upload, seeding and departments controller

Location:
database
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • database/factories/DepartmentFactory.php

    re6c1f87 rb9c4a92  
    2424    public function definition()
    2525    {
    26         $location = $this->faker->unique()->numberBetween(1, 25);
     26        $location = $this->faker->randomNumber('1', '1');
    2727        Storage::disk('local')->makeDirectory('Departments/' . $location);
    2828        return [
    29             'name' => $this->faker->firstName() . " department",
     29            'name' => "Department" . $this->faker->unique()->firstName(),
    3030            'code' => $location,
    31             'location' => Storage::disk('local')->path('') . 'Departments/' . $location,
     31            'location' => Storage::disk('local')->path('') . 'Departments' . DIRECTORY_SEPARATOR . $location,
    3232            'user_id' => $this->faker->numberBetween('1', '2'),
    3333            'created_at' => Carbon::now()
  • database/factories/DocumentFactory.php

    re6c1f87 rb9c4a92  
    2626    {
    2727
    28         $deptID = $this->faker->numberBetween('1', '25');
     28        $deptID = "1";
     29        $name = $this->faker->unique()->firstName();
     30        Storage::disk('local')->makeDirectory('Departments' . DIRECTORY_SEPARATOR . $deptID . DIRECTORY_SEPARATOR . $name);
    2931
    3032        return [
    3133            'arch_id' => $deptID . "/" . $this->faker->unique()->randomNumber(),
    32             'name' => $this->faker->unique()->firstName(),
     34            'name' => $name,
    3335            'description' => $this->faker->realText(),
    3436            'user_id' => $this->faker->numberBetween('1', '2'),
  • database/seeders/DepartmentsTableSeeder.php

    re6c1f87 rb9c4a92  
    1616    public function run()
    1717    {
    18         Department::factory()->count(25)->create();
     18        Department::factory()->count(10)->create();
    1919    }
    2020}
Note: See TracChangeset for help on using the changeset viewer.