| Conditions | 6 |
| Paths | 6 |
| Total Lines | 36 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function run() |
||
| 19 | { |
||
| 20 | $role = Role::firstOrCreate( |
||
|
|
|||
| 21 | [ |
||
| 22 | 'name' => config('panel.adminRole', 'admin'), |
||
| 23 | 'guard_name' => 'web' |
||
| 24 | ] |
||
| 25 | ); |
||
| 26 | |||
| 27 | $permission = Permission::firstOrCreate( |
||
| 28 | [ |
||
| 29 | 'name' => 'access panel', |
||
| 30 | 'guard_name' => 'web' |
||
| 31 | ] |
||
| 32 | ); |
||
| 33 | |||
| 34 | if (! $role->hasPermissionTo('access panel')) { |
||
| 35 | $role->givePermissionTo($permission); |
||
| 36 | } |
||
| 37 | |||
| 38 | if ($this->command->confirm('Create or update a super-admin now?', true)) { |
||
| 39 | $adminEmail = $this->command->ask('Email: ', '[email protected]'); |
||
| 40 | $admin = Admin::firstOrNew( |
||
| 41 | [ |
||
| 42 | 'email' => $adminEmail, |
||
| 43 | ] |
||
| 44 | ); |
||
| 45 | $admin->name = $this->command->ask('Name: ', $admin->name ?: 'Administrator'); |
||
| 46 | if (! $admin->password) { |
||
| 47 | $admin->password = bcrypt( |
||
| 48 | $this->command->secret(' Password: ', $admin->name ?: '12345') |
||
| 49 | ); |
||
| 50 | } |
||
| 51 | $admin->save(); |
||
| 52 | } |
||
| 53 | } |
||
| 54 | } |
||
| 55 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.