当前位置: 首页>>代码示例>>PHP>>正文


PHP Redirect::back方法代码示例

本文整理汇总了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');
         }
     }
 }
开发者ID:nimeshmora,项目名称:OCM-Travel-Bratts,代码行数:31,代码来源:MyChannelController.php

示例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);
     }
 }
开发者ID:orloc,项目名称:seat,代码行数:26,代码来源:RegisterController.php

示例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);
 }
开发者ID:JFSolorzano,项目名称:Acordes,代码行数:14,代码来源:RedirectIfAuthenticated.php

示例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();
 }
开发者ID:billwaddyjr,项目名称:Larabook-1,代码行数:13,代码来源:FollowsControllers.php

示例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');
 }
开发者ID:grupoim,项目名称:bifrost_free,代码行数:7,代码来源:NotaCreditoControlador.php

示例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');
 }
开发者ID:bjohnmer,项目名称:sf,代码行数:33,代码来源:FamiliasController.php

示例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);
         }
     }
 }
开发者ID:BaobabHealthTrust,项目名称:iBLIS,代码行数:33,代码来源:CommodityController.php

示例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;
     }
 }
开发者ID:antinglizi,项目名称:admin,代码行数:39,代码来源:UserController.php

示例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'));
     }
 }
开发者ID:2dan-devs,项目名称:animalshelter,代码行数:31,代码来源:AboutUsController.php

示例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');
 }
开发者ID:ps2maps,项目名称:ps2maps.com,代码行数:34,代码来源:PageController.php

示例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');
             }
         }
     }
 }
开发者ID:nosiliw,项目名称:SCDW,代码行数:39,代码来源:DocenteController.php

示例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'));
 }
开发者ID:2dan-devs,项目名称:animalshelter,代码行数:31,代码来源:ContactUsController.php

示例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();
 }
开发者ID:binaryk,项目名称:lareab,代码行数:35,代码来源:StadiuLivrabilController.php

示例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();
 }
开发者ID:udayrockstar,项目名称:RestaurantManager,代码行数:13,代码来源:SessionsController.php

示例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');
 }
开发者ID:keloxers,项目名称:Cooperativa,代码行数:30,代码来源:ClasificadoscategoriasController.php


注:本文中的Redirect::back方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。