public function run() { DB::table('group_user')->delete(); $user = User::whereEmail('admin')->firstOrFail(); $group = Group::whereType(Group::ADMIN)->firstOrFail(); $group->users()->attach($user); }
/** * Execute the console command. * * @return mixed */ public function fire() { $email = $this->ask('What the user email?'); $user = User::where('email', '=', $email)->firstOrFail(); $password = $this->ask('What the new password?'); $user->password = Hash::make($password); $user->save(); $this->info('Ok, password changed'); }
public function confirm() { Breadcrumbs::addCrumb('Confimar email', Request::fullUrl()); $user = User::find(Input::get('user')); $key = Input::get('key'); $error = $success = null; if ($user->confirm_key == $key) { $user->email_confirmed = 1; $user->save(); $success = 'Email confirmado com sucesso!'; } else { $error = 'Não foi possível confirmar o seu email'; } return View::make('user_panel::front.register.confirm', compact('success', 'error')); }
public function run() { Eloquent::unguard(); DB::table('users')->delete(); User::create(array('name' => 'Admin', 'email' => 'admin', 'password' => Hash::make('admin'), 'created_at' => new DateTime(), 'updated_at' => new DateTime())); }