public function create($request) { $validator = $this->validate($request); if (!$validator->fails()) { Managers::create(['name' => $request['name'], 'email' => $request['email'], 'password' => Hash::make($request['password'])]); Auth::sendNewManagerEmail($request['email']); return redirect()->away('http://' . config('global.origin.current') . $request['redirectonsuccess'] . '?message=Registro realizado com sucesso! Verifique seu email.'); } else { return redirect()->away('http://' . config('global.origin.current') . $request['redirectonerror'] . '?message=' . $validator->errors()->first()); } }