GroupsSeeder.php 1021 Bytes
Newer Older
Jacob Priddy's avatar
Jacob Priddy committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php

use Illuminate\Database\Seeder;
use Source\Gateways\Groups\LocalGroupsRepository;
use Source\Gateways\Groups\DatabaseGroupsRepository;

class GroupsSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @param \Source\Gateways\Groups\DatabaseGroupsRepository $groups
     * @return void
     */
15
    public function run(DatabaseGroupsRepository $groups): void
Jacob Priddy's avatar
Jacob Priddy committed
16
17
18
19
20
21
22
23
24
25
26
27
28
29
    {
        if ($groups->all()) {
            throw new RuntimeException('Cannot seed database as it is not empty.');
        }

        $groups->create(LocalGroupsRepository::getAdminGroup());

        $groups->create(LocalGroupsRepository::getManageUsersGroup());

        $groups->create(LocalGroupsRepository::getManageDoorsGroup());

        $groups->create(LocalGroupsRepository::getCodeQueryGroup());

        $groups->create(LocalGroupsRepository::getManageGroupsGroup());
30
31

        $groups->create(LocalGroupsRepository::getLogViewGroup());
32
33

        $groups->create(LocalGroupsRepository::getDoorCommanderGroup());
Jacob Priddy's avatar
Jacob Priddy committed
34
35
    }
}