src/Commands/Install.php
private function createSuperUser()
    {
        $this->info('Creating a Super User...');

        $firstname = $this->ask('Enter your first name');
        $lastname = $this->ask('Enter your last name');
        $email = $this->ask('Enter your email address');
        $password = $this->secret('Enter a password');

        $data = [
            'first_name' => $firstname,
            'last_name' => $lastname,
            'email' => $email,
            'superuser' => 1,
            'activated' => 1,
            'password' => Hash::make($password),
            'email_verified_at' => Carbon::now(),
        ];

        try {
            User::create($data);
            $this->info('Superuser created.');
        } catch (Exception $e) {
            $this->error('User could not be created.');
        }

        $this->line('------------------');
    }
private function createSuperUser()
    {
        $this->info('Creating a Super User...');

        $firstname = $this->ask('Enter your first name');
        $lastname = $this->ask('Enter your last name');
        $email = $this->ask('Enter your email address');
        $password = $this->secret('Enter a password');

        $data = [
            'first_name' => $firstname,
            'last_name' => $lastname,
            'email' => $email,
            'superuser' => 1,
            'activated' => 1,
            'password' => Hash::make($password),
            'email_verified_at' => Carbon::now(),
        ];

        try {
            User::create($data);
            $this->info('Superuser created.');
        } catch (Exception $e) {
            $this->error('User could not be created.');
        }

        $this->line('------------------');
    }
private function createSuperUser ( ) { $ this -> info ( 'Creating a Super User...' ) ; $ firstname = $ this -> ask ( 'Enter your first name' ) ; $ lastname = $ this -> ask ( 'Enter your last name' ) ; $ email = $ this -> ask ( 'Enter your email address' ) ; $ password = $ this -> secret ( 'Enter a password' ) ; $ data = [ 'first_name' => $ firstname , 'last_name' => $ lastname , 'email' => $ email , 'superuser' => 1 , 'activated' => 1 , 'password' => Hash :: make ( $ password ) , 'email_verified_at' => Carbon :: now ( ) , ] ; try { User :: create ( $ data ) ; $ this -> info ( 'Superuser created.' ) ; } catch ( Exception $ e ) { $ this -> error ( 'User could not be created.' ) ; } $ this -> line ( '------------------' ) ; }
Create a superuser.
Create a superuser .