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!'); }
/** * Run the database seeds. * * @return void */ public function run() { DB::table('organizatii')->truncate(); \Credite\Organizatie::createRecord(['denumire' => 'CreditFin']); }