Exemplo n.º 1
0
 public static function password($password)
 {
     $that = new static(\App::make('validator'));
     $modelName = Club::modelName();
     $model = new $modelName();
     $rules = array_only($that->getUpdateRules($model), 'password');
     $that->validate(compact('password'), $rules);
 }
Exemplo n.º 2
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     $tname = Club::modelTableName();
     $mname = Club::modelName();
     $fullPath = $this->createBaseMigration();
     $this->files->put($fullPath, $this->getMigrationStub());
     $this->info('Migration created successfully !');
     $this->info("Check {$fullPath} to add your own columns to the table.");
     $this->call('dump-autoload');
 }
Exemplo n.º 3
0
 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->package('lud/club');
     require __DIR__ . '/../../routes.php';
     $modelName = Club::modelName();
     $validatorName = Club::modelValidatorName();
     $table = with(new $modelName([]))->getTable();
     // @todo this is bad because it loads all the validation on every
     // request, we must be able to listen to Model::boot event.
     // More, laravel doesn't even reuse this object, it's only taking its
     // class name ...
     $modelName::observe(new $validatorName(App::make('validator')));
 }
Exemplo n.º 4
0
 public function postLostPassword()
 {
     try {
         $this->ensureIsEmail($email = Input::get('email'));
         $model = Club::modelName();
         Session::set('club.login_fail_email', $email);
         $brokerResponse = Password::remind(Input::only('email'), function ($m, $user, $token) {
             $m->subject(Lang::get('club::club.labels.password_recovery_subject'));
             Log::info('Club reminder sent, url = ' . URL::route('club.reset_password_access', array($token)));
         });
         switch ($brokerResponse) {
             case Password::INVALID_USER:
                 $error = Lang::get('club::club.errors.user_not_found');
                 return $this->redirectOnFail('club.lost_password', $error);
             case Password::REMINDER_SENT:
                 return Redirect::back()->with('success', Lang::get('club::club.success.reminder_sent'));
         }
     } catch (ValidationException $e) {
         return $this->redirectOnFail('club.lost_password', $e->messages());
     }
 }