Ejemplo n.º 1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $name = $this->ask('Name : ');
     $email = $this->ask('Email : ');
     $password = $this->secret('Password : '******'name', 'email', 'password'));
     $this->line('Select role:');
     foreach (Role::all() as $role) {
         $this->line($role->id . '. ' . $role->name);
     }
     $role = $this->ask('Role number : ');
     $user->addRole($role);
     $this->info("User [{$user->name}] created successfully.");
 }
Ejemplo n.º 2
0
 public function run()
 {
     $user = User::create(['email' => '*****@*****.**', 'password' => 'suprise']);
     $user->addRole(1);
 }