LaravelAdminSeeder   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 16 1
1
<?php
2
namespace Database\Seeders;
3
4
use Illuminate\Support\Str;
5
use Illuminate\Database\Seeder;
6
use Devfaysal\LaravelAdmin\Models\Admin;
7
use Spatie\Permission\Models\Permission;
8
9
class LaravelAdminSeeder extends Seeder
10
{
11
    /**
12
     * Seed the application's database.
13
     *
14
     * @return void
15
     */
16
    public function run()
17
    {
18
        Permission::create(['guard_name' => 'admin', 'name' => 'access_admin_dashboard']);
19
        Permission::create(['guard_name' => 'admin', 'name' => 'manage_admins']);
20
        Permission::create(['guard_name' => 'admin', 'name' => 'create_admin']);
21
        Permission::create(['guard_name' => 'admin', 'name' => 'manage_trashed_admins']);
22
        Permission::create(['guard_name' => 'admin', 'name' => 'manage_error_logs']);
23
        $admin = Admin::create([
24
                    'name' => 'Faysal Ahamed',
25
                    'email' => '[email protected]',
26
                    'email_verified_at' => now(),
27
                    'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
28
                    'remember_token' => Str::random(10),
29
                ]);
30
        $admin->givePermissionTo(['access_admin_dashboard', 'manage_admins', 'create_admin', 'manage_trashed_admins', 'manage_error_logs']);
31
    }
32
}
33
34