Changeset 0df7a93 for database


Ignore:
Timestamp:
10/24/21 20:55:11 (3 years ago)
Author:
beratkjufliju <kufliju@…>
Branches:
develop, master
Children:
7043def
Parents:
e0d3f94
Message:

bug fixes

Location:
database
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • database/factories/FolderFactory.php

    re0d3f94 r0df7a93  
    2727    public function definition()
    2828    {
    29         $array = [5, 15, 25, 35, 45, 55, 65, 75, 85, 95, 105, 115, 125, 135, 145];
    30 
    31         $deptId = Arr::random($array);
     29        $deptId = 1;
    3230
    3331        $deptCode = Department::find($deptId)->code;
     32
    3433        $name = $this->faker->unique()->firstName();
    3534
  • database/seeders/PermissionsTableSeeder.php

    re0d3f94 r0df7a93  
    1717    {
    1818        \DB::table('permissions')->insert([
    19             ["id" => "1", "name" => "create_user"],                             // Create new user
     19            ["id" => "1", "name" => "view_all_users"],                      // Create new user
    2020            ["id" => "2", "name" => "manage_all_users"],                    // Access all users to manage
    2121            ["id" => "3", "name" => "manage_all_departments"],      // Access all departments to manage
     
    2727            ["id" => "9", "name" => "delete_all_folders"],              // Delete all folder/s
    2828            ["id" => "10", "name" => "delete_folder"],              // Delete your folder/s
    29             ["id" => "11", "name" => "manage_all_files"],               // Access all files
    30             ["id" => "12", "name" => "manage_file_types"],              // Access file types
     29            ["id" => "11", "name" => "view_all_files"],                 // View all files
     30            ["id" => "12", "name" => "manage_all_files"],               // Access all files
     31            ["id" => "13", "name" => "manage_file_types"],              // Access file types
     32            ["id" => "14", "name" => "edit_user_data"],                 // Access file types
     33            ["id" => "15", "name" => "export_data"],                // Access file types
     34            ["id" => "16", "name" => "validation_data"]                 // Access file types
    3135        ]);
    3236    }
  • database/seeders/RolesPermissionsTableSeeder.php

    re0d3f94 r0df7a93  
    2828            ["role_id" => 1, "permission_id" => 11],
    2929            ["role_id" => 1, "permission_id" => 12],
     30            ["role_id" => 1, "permission_id" => 13],
     31            ["role_id" => 1, "permission_id" => 14],
     32            ["role_id" => 1, "permission_id" => 15],
    3033
    31             // Referent
     34                // Referent
     35            ["role_id" => 2, "permission_id" => 1],
    3236            ["role_id" => 2, "permission_id" => 3],
    3337            ["role_id" => 2, "permission_id" => 4],
     
    3943            ["role_id" => 2, "permission_id" => 10],
    4044            ["role_id" => 2, "permission_id" => 11],
     45            ["role_id" => 2, "permission_id" => 13],
     46            ["role_id" => 2, "permission_id" => 14],
     47            ["role_id" => 2, "permission_id" => 15],
    4148
    4249            // Viewer
    4350            ["role_id" => 3, "permission_id" => 5],
    4451            ["role_id" => 3, "permission_id" => 6],
     52            ["role_id" => 3, "permission_id" => 11],
    4553        ]);
    4654    }
  • database/seeders/UsersTableSeeder.php

    re0d3f94 r0df7a93  
    2020            "name" => "Berat",
    2121            "surname" => "Kjufliju",
    22             "username" => "beratk",
     22            "username" => "admin",
    2323            "password" => bcrypt("123456"),
    2424            "email" => "kufliju@gmail.com",
     
    3131        ]);
    3232
     33        \DB::table("users")->insert([
     34            "id" => "2",
     35            "name" => "Berat",
     36            "surname" => "Kjufliju",
     37            "username" => "referent",
     38            "password" => bcrypt("123456"),
     39            "email" => "mail@host.com",
     40            "phone_number" => "+38971201236",
     41            "role_id" => 2,
     42            "is_active" => true,
     43            "is_confirmed" => true,
     44            "created_by" => "1",
     45            "created_at" => now()
     46        ]);
     47
     48        \DB::table("users")->insert([
     49            "id" => "3",
     50            "name" => "Berat",
     51            "surname" => "Kjufliju",
     52            "username" => "viewer",
     53            "password" => bcrypt("123456"),
     54            "email" => "test@test.com",
     55            "phone_number" => "+38971201235",
     56            "role_id" => 3,
     57            "is_active" => true,
     58            "is_confirmed" => true,
     59            "created_by" => "1",
     60            "created_at" => now()
     61        ]);
     62
    3363        User::factory()->count(50)->create();
    3464
Note: See TracChangeset for help on using the changeset viewer.