| Conditions | 1 |
| Paths | 1 |
| Total Lines | 26 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function handle(): void |
||
| 31 | { |
||
| 32 | $this->warn($this->description); |
||
| 33 | |||
| 34 | $this->call('db:seed', ['--class' => 'CortexFortSeeder']); |
||
| 35 | |||
| 36 | $user = [ |
||
| 37 | 'username' => 'Fort', |
||
| 38 | 'email' => '[email protected]', |
||
| 39 | 'email_verified' => true, |
||
| 40 | 'is_active' => true, |
||
| 41 | ]; |
||
| 42 | |||
| 43 | $user = tap(app('cortex.fort.user')->firstOrNew($user)->fill([ |
||
| 44 | 'email_verified_at' => now(), |
||
| 45 | 'remember_token' => str_random(10), |
||
| 46 | 'password' => $password = str_random(), |
||
| 47 | ]), function ($instance) { |
||
| 48 | $instance->save(); |
||
| 49 | }); |
||
| 50 | |||
| 51 | // Assign roles |
||
| 52 | $user->assign('superadmin'); |
||
| 53 | |||
| 54 | $this->table(['Username', 'Password'], [['username' => $user['username'], 'password' => $password]]); |
||
| 55 | } |
||
| 56 | } |
||
| 57 |