public function storeAccount()
 {
     $userManager = new \KodeInfo\UserManagement\UserManagement();
     try {
         $user = $userManager->createUser(Input::all(), Input::get('group', 'admin'), true);
         if (Input::hasFile('avatar')) {
             $user->avatar = \Cashout\Helpers\Utils::imageUpload(Input::file('avatar'), 'profile');
             $user->save();
         }
         Session::flash('success_msg', 'Admin created successfully');
         return Redirect::back();
     } catch (\KodeInfo\UserManagement\Exceptions\AuthException $e) {
         Session::flash('error_msg', \Cashout\Helpers\Utils::buildMessages($e->getErrors()));
         return Redirect::back();
     }
 }
예제 #2
0
 public function postLogin()
 {
     try {
         $this->userManager->login(["email" => Input::get('email'), "password" => Input::get('password')], Input::has('remember_me'), true);
         return Redirect::to('/dashboard');
     } catch (\KodeInfo\UserManagement\Exceptions\AuthException $e) {
         Session::flash('error_msg', Utils::buildMessages($e->getErrors()));
         return Redirect::back();
     }
 }