| Conditions | 4 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | public function handle() |
||
| 43 | { |
||
| 44 | try { |
||
| 45 | $this->users->forceCreate([ |
||
| 46 | 'id' => (string) Uuid::uuid1(), |
||
| 47 | 'username' => $this->option('username') ?: $this->ask('Please enter desired username'), |
||
| 48 | 'password' => Hash::make($this->option('password') ?: $this->ask('Please enter desired password')) |
||
| 49 | ]); |
||
| 50 | } catch (Exception $e) { |
||
| 51 | $this->error("An error occurred: {$e->getMessage()}"); |
||
| 52 | return 1; |
||
| 53 | } |
||
| 54 | |||
| 55 | $this->info('User created successfully'); |
||
| 56 | } |
||
| 57 | |||
| 59 |