Completed
Push — master ( fcadec...5798cc )
by Mahmoud
03:32
created

AuthorizationRolesSeeder_2::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace App\Containers\Authorization\Data\Seeders;
4
5
use App\Containers\Authorization\Actions\CreateRoleAction;
6
use App\Port\Seeder\Abstracts\Seeder;
7
8
/**
9
 * Class AuthorizationRolesSeeder_2
10
 *
11
 * @author  Mahmoud Zalt  <[email protected]>
12
 */
13
class AuthorizationRolesSeeder_2 extends Seeder
14
{
15
16
    /**
17
     * @var  \App\Containers\Authorization\Actions\CreateRoleAction
18
     */
19
    private $createRoleAction;
20
21
    /**
22
     * RolesSeeder constructor.
23
     *
24
     * @param \App\Containers\Authorization\Actions\CreateRoleAction $createRoleAction
25
     */
26
    public function __construct(CreateRoleAction $createRoleAction)
27
    {
28
        $this->createRoleAction = $createRoleAction;
29
    }
30
31
    /**
32
     * Run the database seeds.
33
     *
34
     * @return void
35
     */
36
    public function run()
37
    {
38
        // Default Roles ----------------------------------------------------------------
39
40
        $this->createRoleAction->run('admin', 'Super Administrator')->givePermissionTo([
41
            'admin-access', 'manage-roles-permissions',
42
        ]);
43
44
        $this->createRoleAction->run('client', 'Normal User');
45
46
        // ...
47
48
    }
49
}
50