mysql - Laravel : How do I securely seed the first user

PHOTO EMBED

Sun Feb 12 2023 16:03:58 GMT+0000 (Coordinated Universal Time)

Saved by @eneki #laravel

public function handle()
{
    $first_name = $this->ask('What is the first name?');
    $last_name = $this->ask('What is the last name?');
    $email = $this->ask('What is the email address?');
    $password = $this->secret('What is the password?');

    AdminUser::create([
        'first_name' => $first_name,
        'last_name' => $last_name,
        'email' => $email,
        'password' => bcrypt($password)
    ]);

    $this->info("User $first_name $last_name was created");
}
content_copyCOPY

https://stackoverflow.com/questions/34382043/laravel-how-do-i-insert-the-first-user-in-the-database