GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( a409ed...508770 )
by Aden
10:44 queued 04:29
created

MakeAdminCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace LaravelFlare\Flare\Console\Commands;
4
5
use Illuminate\Console\Command;
6
7
class MakeAdminCommand extends Command
8
{
9
    /**
10
     * The console command name.
11
     *
12
     * @var string
13
     */
14
    protected $name = 'make:admin';
15
16
    /**
17
     * The console command description.
18
     *
19
     * @var string
20
     */
21
    protected $description = 'Creates a new admin user';
22
23
    /**
24
     * __construct.
25
     */
26
    public function __construct()
27
    {
28
        parent::__construct();
29
    }
30
31
    /**
32
     * Run the command.
33
     */
34
    public function fire()
35
    {
36
        $name = $this->ask('Please provide a username (defaults to admin)', 'admin');
37
        $email = $this->ask('Please provide your email (defaults to [email protected])', '[email protected]');
38
        $password = $this->ask('Please provide a password (defaults to password)', 'password');
39
40
        $authModel = config('auth.model');
41
42
        $authModel::unguard();
43
44 View Code Duplication
        if ((new $authModel())->create(['name' => $name, 'email' => $email, 'password' => bcrypt($password), 'is_admin' => true])) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
45
            $this->info('All done!');
46
47
            return;
48
        }
49
50
        $authModel::reguard();
51
52
        $this->error('Something went wrong... Please try again.');
53
    }
54
}
55