Completed
Push — master ( 17a334...ed601b )
by Mahmoud
02:57
created

RolesSeeder::__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
class RolesSeeder extends Seeder
9
{
10
11
    /**
12
     * @var  \App\Containers\Authorization\Actions\CreateRoleAction
13
     */
14
    private $createRoleAction;
15
16
    /**
17
     * RolesSeeder constructor.
18
     *
19
     * @param \App\Containers\Authorization\Actions\CreateRoleAction $createRoleAction
20
     */
21
    public function __construct(CreateRoleAction $createRoleAction)
22
    {
23
        $this->createRoleAction = $createRoleAction;
24
    }
25
26
    /**
27
     * Run the database seeds.
28
     *
29
     * @return void
30
     */
31
    public function run()
32
    {
33
        // Default Roles ----------------------------------------------------------------
34
35
        $this->createRoleAction->run('admin', 'Super Administrator')->givePermissionTo([
36
            'admin-access', 'manage-roles-permissions',
37
        ]);
38
39
        $this->createRoleAction->run('client', 'Normal User');
40
41
        // ...
42
43
    }
44
}
45