/**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $input = Input::only('email', 'password', 'password_confirmation', 'first_name', 'last_name');
     $this->registrationForm->validate($input);
     $input = Input::only('email', 'password', 'first_name', 'last_name');
     $input = array_add($input, 'activated', true);
     $user = $this->user->create($input);
     // Find the group using the group name
     $usersGroup = Sentry::findGroupByName('Users');
     // Assign the group to the user
     $user->addGroup($usersGroup);
     return Redirect::to('login')->withFlashMessage('User Successfully Created!');
 }
 /**      * Store a newly created resource in storage.      *      *
 @return Response      */
 public function store()
 {
     $input = Input::only('name', 'email', 'password', 'password_confirmation', 'mobile', 'company_name', 'designation', 'country', 'city', 'address', 'pin_code', 'phone', 'business_type', 'others', 'turnover', 'pan', 'terms', 'images');
     $this->registrationForm->validate($input);
     $input = Input::only('name', 'email', 'password', 'mobile', 'company_name', 'designation', 'country', 'city', 'address', 'pin_code', 'phone', 'business_type', 'others', 'turnover', 'pan', 'terms');
     $input = array_add($input, 'activated', true);
     $user = $this->user->create($input);
     // Find the group using the group name
     $usersGroup = Sentry::findGroupByName('Users');
     // Assign the group to the user
     $user->addGroup($usersGroup);
     $data = array('myNumber' => '09279088882');
     Mail::send('emails.registertemplate', $data, function ($message) {
         $message->subject('Welcome To Scrapkart');
         $message->to('*****@*****.**');
         // Recipient
     });
     return Redirect::to('login')->withFlashMessage('User Successfully Created!');
 }
 public function store()
 {
     $input = Input::only('email', 'password', 'password_confirmation', 'prenume', 'nume');
     try {
         $this->registrationForm->validate($input);
     } catch (Exception $e) {
         return Redirect::back()->withInput()->withErrors($e->getErrors());
     }
     $input = Input::only('email', 'password', 'prenume', 'nume');
     // !!!!!!!! Temporar pentru logarea pe app
     $id_organizatie = \Credite\Organizatie::createRecord(['denumire' => 'Organizatia lui: ' . $input['nume']])->id;
     $input['id_organizatie'] = $id_organizatie;
     $input = array_add($input, 'activated', true);
     $user = $this->user->create($input);
     // Find the group using the group name
     $usersGroup = Sentry::findGroupByName('Users');
     // Assign the group to the user
     $user->addGroup($usersGroup);
     return Redirect::to('login')->withFlashSuccess('Utilizator creat cu succes!');
 }