Changeset 194a359 for database/seeders


Ignore:
Timestamp:
09/30/21 00:32:27 (3 years ago)
Author:
beratkjufliju <kufliju@…>
Branches:
develop, master
Children:
24a616f
Parents:
582789f
Message:

added departments, edited users and added user settings

Location:
database/seeders
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • database/seeders/DatabaseSeeder.php

    r582789f r194a359  
    1818        $this->call(RolesPermissionsTableSeeder::class);
    1919        $this->call(UsersTableSeeder::class);
     20        $this->call(DepartmentsTableSeeder::class);
    2021    }
    2122}
  • database/seeders/PermissionsTableSeeder.php

    r582789f r194a359  
    44
    55use Illuminate\Database\Seeder;
     6
     7
    68
    79class PermissionsTableSeeder extends Seeder
     
    1416    public function run()
    1517    {
    16         //
     18        \DB::table('permissions')->insert([
     19            ["name" => "create_user"],                          // Create new user
     20            ["name" => "access_all_users"],             // Access to all users to manage
     21            ["name" => "access_all_departments"],               // Access to all departments to manage
     22        ]);
    1723    }
    1824}
  • database/seeders/RolesPermissionsTableSeeder.php

    r582789f r194a359  
    1414    public function run()
    1515    {
    16         //
     16        \DB::table('roles_permissions')->insert([
     17            // Admin
     18            ["role_id" => 1, "permission_id" => 1],
     19            ["role_id" => 1, "permission_id" => 2],
     20            ["role_id" => 1, "permission_id" => 3],
     21
     22            // Referent
     23            ["role_id" => 2, "permission_id" => 3]
     24        ]);
    1725    }
    1826}
  • database/seeders/RolesTableSeeder.php

    r582789f r194a359  
    1515    {
    1616        \DB::table('roles')->insert([
    17             ["name" => "admin"], // Have access to all users(managing users), departments, documents etc
    18             ["name" => "referent"], // Have access to all departments, documents etc
     17            ["name" => "Admin"], // Have access to all users(managing users), departments, documents etc
     18            ["name" => "Referent"], // Have access to all departments, documents etc
    1919        ]);
    2020    }
  • database/seeders/UsersTableSeeder.php

    r582789f r194a359  
    2828        ]);
    2929
     30        \DB::table("users")->insert([
     31            "name" => "John",
     32            "surname" => "Doe",
     33            "username" => "john_doe",
     34            "password" => bcrypt("Johnsecret1!"),
     35            "email" => "johndoe@hotmail.com",
     36            "mobile_number" => "+389 71 111 222",
     37            "role_id" => 2,
     38            "is_active" => true,
     39            "is_confirmed" => true,
     40            "created_at" => Carbon::now()
     41        ]);
     42
    3043        //factory(App\Models\User::class, 50)->create();
    3144    }
Note: See TracChangeset for help on using the changeset viewer.