Completed
Push — master ( 2e679b...98d63a )
by Jeremy
25:07 queued 21:11
created

ConnectRelationshipsSeeder::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 13
rs 10
c 0
b 0
f 0
1
<?php
2
3
use Illuminate\Database\Seeder;
4
5
class ConnectRelationshipsSeeder extends Seeder
6
{
7
    /**
8
     * Run the database seeds.
9
     *
10
     * @return void
11
     */
12
    public function run()
13
    {
14
        /**
15
         * Get Available Permissions.
16
         */
17
        $permissions = config('roles.models.permission')::all();
18
19
        /**
20
         * Attach Permissions to Roles.
21
         */
22
        $roleAdmin = config('roles.models.role')::where('name', '=', 'Admin')->first();
23
        foreach ($permissions as $permission) {
24
            $roleAdmin->attachPermission($permission);
25
        }
26
    }
27
}
28