當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。