本文整理汇总了PHP中Redirect::back方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::back方法的具体用法?PHP Redirect::back怎么用?PHP Redirect::back使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Redirect
的用法示例。
在下文中一共展示了Redirect::back方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postOwnerDetail
public function postOwnerDetail()
{
$validator = Validator::make(Input::all(), array('full_name' => 'required|max:250', 'address' => 'required|max:250', 'city' => 'required|max:250', 'country' => 'required|max:250', 'email' => 'required|email|max:250', 'tele' => 'required|max:250', 'description' => 'required|max:600'));
if ($validator->fails()) {
return Redirect::back()->withErrors($validator)->withInput();
} else {
$fullname = Input::get('full_name');
$address = Input::get('address');
$city = Input::get('city');
$country = Input::get('country');
$email = Input::get('email');
$tele = Input::get('tele');
$mobile = Input::get('mobile');
$description = Input::get('description');
$mytime = Carbon\Carbon::now();
$insertToHotelOwnerTable = DB::table('hotel_owner')->insert(['fullname' => $fullname, 'address' => $address, 'city' => $city, 'country' => $country, 'telephone' => $tele, 'mobile' => $mobile, 'email' => $email, 'details' => $description, 'company_id' => Auth::user()->comp_id, 'created_at' => $mytime->toDateTimeString(), 'updated_at' => $mytime->toDateTimeString()]);
if ($insertToHotelOwnerTable) {
$role = Auth::user()->role;
switch ($role) {
case 'hotel-admin':
return Redirect::route('company-profile');
break;
case 'hotel-staff':
return Redirect::route('dashboard-logged-staff');
break;
}
} else {
return Redirect::route('add-room');
}
}
}
示例2: postNew
public function postNew()
{
$validation = new Validators\SeatUserRegisterValidator();
if ($validation->passes()) {
// Let's register a user.
$user = new \User();
$user->email = Input::get('email');
$user->username = Input::get('username');
$user->password = Hash::make(Input::get('password'));
$user->tsid = Input::get('tsid');
$user->activation_code = str_random(24);
$user->activated = 1;
$user->save();
// Prepare data to be sent along with the email. These
// are accessed by their keys in the email template
$data = array('activation_code' => $user->activation_code);
// Send the email with the activation link
Mail::send('emails.auth.register', $data, function ($message) {
$message->to(Input::get('email'), 'New SeAT User')->subject('SeAT Account Confirmation');
});
// And were done. Redirect to the login again
return Redirect::action('SessionController@getSignIn')->with('success', 'Successfully registered a new account. Please check your email for the activation link.');
} else {
return Redirect::back()->withInput()->withErrors($validation->errors);
}
}
示例3: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if ($this->auth->check()) {
return \Redirect::back();
}
return $next($request);
}
示例4: destroy
/**
* Unfollow a user
*
* @param $userIdToUnfollow
* @return Response
*/
public function destroy($userIdToUnfollow)
{
$input = array_add(Input::all(), 'userId', Auth::id());
$this->execute(UnfollowUserCommand::class, $input);
Flash::success("You have now unfollowed this user.");
return Redirect::back();
}
示例5: getBaja
public function getBaja($id)
{
$nota_credito = Cupon::find($id);
$nota_credito->activo = 0;
$nota_credito->save();
return Redirect::back()->with('status', 'cupon_baja');
}
示例6: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
$familia = Familia::findOrFail($id);
$validator = Familia::validator(Input::all());
if ($validator->fails()) {
return Redirect::back()->withErrors($validator)->withInput();
}
$datos = Input::all();
if (Input::file('foto')) {
$file = Input::file('foto');
$destinationPath = 'uploads/images/';
$filename = Str::random(20) . '.' . $file->getClientOriginalExtension();
$mimeType = $file->getMimeType();
$extension = $file->getClientOriginalExtension();
$upload_success = $file->move($destinationPath, $filename);
if ($familia->foto != 'fam.jpg') {
File::delete($destinationPath . $familia->foto);
}
$datos['foto'] = $filename;
} else {
unset($datos['foto']);
}
$familia->update($datos);
Session::flash('message', 'Actualizado Correctamente');
Session::flash('class', 'success');
return Redirect::to('/dashboard/familia');
}
示例7: update
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
//Validate
$rules = array('name' => 'required');
$validator = Validator::make(Input::all(), $rules);
// process the validation
if ($validator->fails()) {
return Redirect::back()->withErrors($validator)->withInput(Input::except('password'));
} else {
// Update
$commodity = Commodity::find($id);
$commodity->name = Input::get('name');
$commodity->description = Input::get('description');
$commodity->metric_id = Input::get('unit_of_issue');
$commodity->unit_price = Input::get('unit_price');
$commodity->item_code = Input::get('item_code');
$commodity->storage_req = Input::get('storage_req');
$commodity->min_level = Input::get('min_level');
$commodity->max_level = Input::get('max_level');
try {
$commodity->save();
return Redirect::route('commodity.index')->with('message', trans('messages.success-updating-commodity'))->with('activecommodity', $commodity->id);
} catch (QueryException $e) {
Log::error($e);
}
}
}
示例8: postModify
/**
* 修改账户基本信息
*
* @return Response
*/
public function postModify()
{
$data = Input::all();
$userInfoType = Input::get('user_info_type');
$user = Auth::user();
switch ($userInfoType) {
case USER_INFO_0:
$rules = array('user_nickname' => 'max:64', 'user_email' => 'email');
$validator = Validator::make($data, $rules);
if ($validator->fails()) {
return Redirect::back()->withInput()->withErrors($validator);
}
$userNickName = Input::get('user_nickname');
$userEmail = Input::get('user_email');
$user->wy_nick_name = $userNickName;
$user->wy_email = $userEmail;
$result = $user->save();
if ($result) {
return Redirect::back()->with('success', Lang::get('messages.10021'));
} else {
$context = array("errorCode" => -15008, "userID" => $user->wy_user_id, "data" => $data);
Log::error(Lang::get('errormessages.-15008'), $context);
return Redirect::back()->withInput()->with('error', Lang::get('errormessages.-15008'));
}
break;
case USER_INFO_1:
break;
default:
$context = array("errorCode" => -10027, "userID" => $user->wy_user_id, "data" => $data);
Log::error(Lang::get('errormessages.-10027'), $context);
return Redirect::back()->with('error', Lang::get('errormessages.-10027'));
break;
}
}
示例9: update
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function update($id)
{
// Get input and save into variable.
$data = Input::all();
// Validate input data.
$val = AboutUs::validate($data);
// If validator fails show errors to user.
if ($val->fails()) {
return Redirect::back()->withErrors($val);
}
// If no validation errors, update About Us information on database.
$aboutus = AboutUs::find($id);
$aboutus->title = Input::get('title');
$aboutus->body = Input::get('body');
// Get original data to compare if changes were made.
$original = AboutUs::find($id);
// Check if changes were made, if so, save to form, if no, redirect back with message.
if ($original->title != $aboutus->title || $original->body != $aboutus->body) {
$aboutus->save();
// Redirect with success message.
return Redirect::back()->with('message', FlashMessage::DisplayAlert('Information Updated Successfully!', 'success'));
} else {
// No changes were made, redirect back with warning message.
return Redirect::back()->with('message', FlashMessage::DisplayAlert('Nothing to update. No changes made.', 'warning'));
}
}
示例10: postSettings
public function postSettings()
{
// Hex RGB Custom Validator
Validator::extend('hex', function ($attribute, $value, $parameters) {
return preg_match("/^\\#[0-9A-Fa-f]{6}\$/", $value);
});
// Validation Rules
$rules = ['nc-color' => 'required|hex', 'tr-color' => 'required|hex', 'vs-color' => 'required|hex', 'time-format' => 'required|in:12,24'];
// Validation
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
return Redirect::back();
}
// Save Hex and Dark Hex colors to Session
foreach (['nc', 'tr', 'vs'] as $faction) {
$color = strtolower(Input::get("{$faction}-color"));
// Chosen color
Session::put("faction-colors.{$faction}.default", $color);
// Color darkened by 50%
Session::put("faction-colors.{$faction}.dark", $this->adjustColorLightenDarken($color, 50));
// Outline color
if ($color == Config::get("ps2maps.faction-colors.{$faction}.default")) {
// If color is default color, use white outline
$outline = "#FFF";
} else {
// Otherwise use calculated outline color
$outline = $this->closerToBlackOrWhite(Input::get("{$faction}-color")) == "#FFF" ? "#000" : "#FFF";
}
Session::put("faction-colors.{$faction}.outline", $outline);
}
// Save time format to session
Session::put('time-format', Input::get('time-format'));
return Redirect::back()->with('message', 'Settings Saved');
}
示例11: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
$input = Input::all();
$regla = ['codigo' => 'required|max:6', 'apellidopaterno' => 'required', 'apellidomaterno' => 'required', 'nombre' => 'required'];
$validacion = Validator::make($input, $regla);
if ($validacion->fails()) {
return Redirect::back()->withErrors($validacion);
} else {
$nombre = Input::get('nombre');
$apellidopaterno = Input::get('apellidopaterno');
$apellidomaterno = Input::get('apellidomaterno');
$codigo = Input::get('codigo');
if ($iddocente = Docente::where('codDocente', '=', $codigo)->first()) {
$error = ['wilson' => 'El codigo ' . $codigo . ' ya existe'];
return Redirect::back()->withInput()->withErrors($error);
} else {
if ($ddocente = Docente::where('nombre', '=', $nombre)->where('apellidoP', '=', $apellidopaterno)->where('apellidoM', '=', $apellidomaterno)->first()) {
$error = ['wilson' => 'Este docente ya ha sido insertado'];
return Redirect::back()->withInput()->withErrors($error);
} else {
$Docente = new Docente();
$Docente->codDocente = Input::get('codigo');
$Docente->nombre = Input::get('nombre');
$Docente->apellidoM = Input::get('apellidomaterno');
$Docente->apellidoP = Input::get('apellidopaterno');
$Docente->categoria = Input::get('categoria');
$Docente->email = Input::get('email');
$Docente->codDptoAcademico = Input::get('iddepartamento');
$Docente->save();
return Redirect::to('docente/listar');
}
}
}
}
示例12: update
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function update($id)
{
$input = Input::all();
$val = ContactUs::validate($input);
if ($val->fails()) {
return Redirect::back()->withErrors($val);
}
$contactus = ContactUs::find($id);
$contactus->title = Input::get('title');
$contactus->address = Input::get('address');
$contactus->city = Input::get('city');
$contactus->state = Input::get('state');
$contactus->zip = Input::get('zip');
$contactus->email_1 = Input::get('email_1');
$contactus->email_2 = Input::get('email_2');
$contactus->phone_1 = Input::get('phone_1');
$contactus->phone_2 = Input::get('phone_2');
// Original record
$original = ContactUs::find($id);
// If nothing changed do not make call to database and return with warning message.
if ($original->title != $contactus->title || $original->address != $contactus->address || $original->city != $contactus->city || $original->state != $contactus->state || $original->zip != $contactus->zip || $original->email_1 != $contactus->email_1 || $original->email_2 != $contactus->email_2 || $original->phone_1 != $contactus->phone_1 || $original->phone_2 != $contactus->phone_2) {
$contactus->save();
return Redirect::back()->with('message', FlashMessage::DisplayAlert('Information Updated Successfully!', 'success'));
}
return Redirect::back()->with('message', FlashMessage::DisplayAlert('Nothing to update. No changes made.', 'warning'));
}
示例13: postSchimbaStadiu
public function postSchimbaStadiu($id_livrabil)
{
$actualizare_ore = Input::get('ore_lucrate') > 0;
$is_stadiu = Input::get('stadiu_selectionat') != null && Input::get('stadiu_selectionat') > 0;
$array_update = array();
if ($is_stadiu) {
//Face insert in tabela de istoric de stadii
//Actualizeaza stadiul livrabilului
$array_update = array_add($array_update, 'id_stadiu', Input::get('stadiu_selectionat'));
}
if ($actualizare_ore) {
//Actualizeaza numarul de ore lucrate la acest livrabil
$array_update = array_add($array_update, 'ore_lucrate', Input::get('ore_lucrate'));
}
// Start transaction!
DB::beginTransaction();
if ($is_stadiu) {
try {
DB::table('istoric_stadii_livrabil')->insertGetId(array('id_livrabil_etapa' => Input::get('id_livrabil_etapa'), 'id_stadiu' => Input::get('stadiu_selectionat'), 'id_user' => Entrust::user()->id));
} catch (Exception $e) {
DB::rollback();
return Redirect::back()->with('message', 'Eroare salvare date: ' . $e);
}
}
if ($is_stadiu || $actualizare_ore) {
try {
DB::table('livrabile_etapa')->where('id', Input::get('id_livrabil_etapa'))->update($array_update);
} catch (Exception $e) {
DB::rollback();
return Redirect::back()->with('message', 'Eroare salvare date: ' . $e);
}
}
DB::commit();
return Redirect::back()->with('message', 'Actualizare realizata cu succes!')->withInput();
}
示例14: store
/**
* Store a newly created resource in storage.
* POST /sessions
*
* @return Response
*/
public function store()
{
if (Auth::attempt(Input::only('email', 'password'))) {
return Redirect::to('/reservation');
}
return Redirect::back();
}
示例15: store
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
// var_dump(Input::All());
// die;
//
// 'categorias_id' => 'exists:rubros,id'
$rules = ['articulo' => 'required', 'copete' => 'required', 'texto' => 'required'];
if (!Articulo::isValid(Input::all(), $rules)) {
return Redirect::back()->withInput()->withErrors(Articulo::$errors);
}
$articulo = new Articulo();
$articulo->users_id = Sentry::getUser()->id;
$articulo->articulo = Input::get('articulo');
$articulo->copete = Input::get('copete');
$articulo->texto = Input::get('texto');
$articulo->tipo = Input::get('tipo');
$articulo->categorias_id = Input::get('categorias_id');
$url_seo = Input::get('articulo');
$articulo->estado = 'nuevo';
//$url_seo = $this->url_slug($url_seo) . implode("-",getdate());
$url_seo = $this->url_slug($url_seo) . date('ljSFY');
$articulo->url_seo = $url_seo;
$articulo->save();
return Redirect::to('/articulos/ver');
}