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


PHP Redirect::back方法代码示例

本文整理汇总了PHP中Illuminate\Support\Facades\Redirect::back方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::back方法的具体用法?PHP Redirect::back怎么用?PHP Redirect::back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Support\Facades\Redirect的用法示例。


在下文中一共展示了Redirect::back方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: regenerateApiKey

 /**
  * Regenerates the users API key.
  *
  * @return \Illuminate\View\View
  */
 public function regenerateApiKey(User $user)
 {
     segment_track('User Management', ['event' => 'regenrated_api_token']);
     $user->api_key = User::generateApiKey();
     $user->save();
     return Redirect::back();
 }
开发者ID:2bj,项目名称:Cachet,代码行数:12,代码来源:UserController.php

示例2: select

 public function select($ticketId, $commentId)
 {
     $ticket = $this->ticketRepository->findOrFail($ticketId);
     $this->authorize('selectResource', $ticket);
     $ticket->assignResource($commentId);
     return Redirect::back();
 }
开发者ID:resand,项目名称:teachme,代码行数:7,代码来源:TicketsController.php

示例3: update

 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(Request $request, $id)
 {
     $service = service::findOrFail($id);
     $validator = Validator::make($data = Input::all(), service::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     /**
      * Check if Request param contains
      * status, if so activate
      * if not deactivate status
      */
     $status_exists = false;
     foreach ($data as $key => $value) {
         if ($key == 'status') {
             $status_exists = true;
         }
     }
     if ($status_exists) {
         $data['status'] = 1;
     } else {
         $data['status'] = 0;
     }
     $service->update($data);
     return Redirect::route('admin.services.index');
 }
开发者ID:hshifaz,项目名称:website,代码行数:33,代码来源:servicesController.php

示例4: postIndex

 public function postIndex()
 {
     $imagem = Input::file('imagem');
     if (is_null($imagem)) {
         throw new Exception('Você não selecionou um arquivo');
     }
     $destinationPath = public_path() . DIRECTORY_SEPARATOR . 'uploads';
     $filename = date('YmdHis') . '_' . $imagem->getClientOriginalName();
     if ($imagem->move($destinationPath, $filename)) {
         //Load view laravel paths
         $paths = Config::get('view.paths');
         //Load file view
         $file = $paths[0] . DIRECTORY_SEPARATOR . Input::get('view') . '.blade.php';
         $html = file_get_contents($file);
         //Init crawler
         $crawler = new HtmlPageCrawler($html);
         //Set filter
         $filter = '#' . Input::get('id');
         //Edit node
         $crawler->filter($filter)->setAttribute('src', '/uploads/' . $filename);
         $newHTML = html_entity_decode($crawler->saveHTML());
         $newHTML = str_replace('%7B%7B', '{{', $newHTML);
         $newHTML = str_replace('%7D%7D', '}}', $newHTML);
         $newHTML = str_replace('%24', '$', $newHTML);
         $newHTML = str_replace('%20', ' ', $newHTML);
         $newHTML = str_replace('%7C', '|', $newHTML);
         //write file
         file_put_contents($file, $newHTML);
         return Redirect::back()->with('alert', 'Banner enviado com sucesso!');
     }
 }
开发者ID:jansenfelipe,项目名称:laraeditable,代码行数:31,代码来源:LaraimgeditableController.php

示例5: excel

 public function excel(Request $request)
 {
     try {
         Log::info(Input::file('input_excel'));
         Excel::load($request->file('input_excel'), function ($reader) {
             $array = $reader->toArray();
             Log::info($array);
             $banqueId = $this->gestSession->addBanqueByExcel($array[0]);
             Log::info("IdBanque1 " . $banqueId);
             $i = 1;
             while ($i < sizeof($array)) {
                 Log::info($array);
                 $titreIdGItem = $this->gestSession->addTitreGItemByExcel($array[$i]);
                 Log::info("IdTitreGItem " . $titreIdGItem);
                 $i++;
                 while ($i < sizeof($array) && $array[$i]["label_item"] != null) {
                     $this->gestSession->addItemByExcel($array[$i], $banqueId, $titreIdGItem);
                     $i++;
                 }
             }
         });
         return Redirect::back();
     } catch (\Exception $e) {
         echo "Format Incorrect";
     }
 }
开发者ID:S4M37,项目名称:Project_GangOfThree,代码行数:26,代码来源:BanqueController.php

示例6: updateProfile

 public function updateProfile(Request $request)
 {
     $input = Input::except('_token', 'image', 'x', 'y', 'w', 'h', 'old_image');
     foreach ($input as $key => $value) {
         $update = User::find(Auth::user()->id);
         $update->{$key} = $value;
         $update->save();
     }
     $image = Input::file('image');
     if (!empty($image)) {
         $filename = time() . '.' . $image->getClientOriginalExtension();
         $path = public_path('profiles/' . $filename);
         $image_x = $request->x;
         $image_y = $request->y;
         $image_width = $request->w;
         $image_height = $request->h;
         $old_image = $request->old_image;
         Image::make($image->getRealPath())->crop($image_width, $image_height, $image_x, $image_y)->resize(250, 250)->save($path);
         File::delete($old_image);
         $update = User::find(Auth::user()->id);
         $update->image = $filename;
         $update->save();
     }
     return Redirect::back();
 }
开发者ID:keshavkatwe,项目名称:advsystem,代码行数:25,代码来源:Member.php

示例7: permissionsDelete

 public function permissionsDelete($id, $permission)
 {
     $role = $this->model->findOrFail($id);
     $role->perms()->detach($permission);
     flash()->success(trans('LaravelAdmin::laravel-admin.permissionsDetachedSuccess'));
     return Redirect::back();
 }
开发者ID:shinichi81,项目名称:laravel-admin,代码行数:7,代码来源:RolesController.php

示例8: handle

 /**
  * Run the login throttling middleware.
  *
  * We're verifying that the user is not attempting to brute force Cachet's
  * login system. If the user has reached the rate limit, then we're sending
  * them away, otherwise, we do nothing, and allow them to continue.
  *
  * Note that this filter is not responsible for incrementing the hit count.
  * Another part of Cachet will increment the hit count for the given route
  * only if validation passes, and the user did not successfully login.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure                 $next
  *
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!Throttle::check($request, 10, 10)) {
         return Redirect::back()->with('error', 'You have made too many login requests.');
     }
     return $next($request);
 }
开发者ID:hd-deman,项目名称:Cachet,代码行数:23,代码来源:LoginThrottling.php

示例9: setTheme

 /**
  * 设置主题
  * @param Request $request
  */
 public function setTheme(Request $request)
 {
     $this->validate($request, ['theme' => 'required']);
     $cookie = Cookie::make('theme', $request->theme, 10 * 12 * 30 * 24 * 60);
     //10年
     return Redirect::back()->withCookie($cookie);
 }
开发者ID:valleyblvd,项目名称:YueFang-ops-web,代码行数:11,代码来源:SettingController.php

示例10: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $validacao = Validator::make($request->all(), ['email' => 'string', 'telefone' => 'string', 'rua' => 'string', 'bairro' => 'string', 'cidade' => 'string', 'estado' => 'string', 'numero' => 'string', 'cep' => 'string', 'complemento' => 'string', 'latitude' => 'string', 'longitude' => 'string', 'facebook' => 'string', 'googleplus' => 'string', 'twitter' => 'string', 'instagran' => 'string']);
     if ($validacao->fails()) {
         return redirect('admin/configuracoes/contato')->withErrors($validacao)->withInput();
     } else {
         try {
             $contato = Contatos::findOrFail($id);
             $contato->email = $request->email;
             $contato->telefone = $request->telefone;
             $contato->rua = $request->rua;
             $contato->bairro = $request->bairro;
             $contato->cidade = $request->cidade;
             $contato->estado = $request->estado;
             $contato->numero = $request->numero;
             $contato->cep = $request->cep;
             $contato->complemento = $request->complemento;
             $contato->latitude = $request->latitude;
             $contato->longitude = $request->longitude;
             $contato->facebook = $request->facebook;
             $contato->googleplus = $request->googleplus;
             $contato->twitter = $request->twitter;
             $contato->instagran = $request->instagran;
             $contato->save();
             session()->flash('flash_message', 'Registro atualizado com sucesso!');
         } catch (\Exception $e) {
             LogR::exception($contato, $e);
             session()->flash('flash_message', 'Ops!! Ocorreu algum problema!. ' . $e->getMessage());
         }
         return Redirect::back();
     }
 }
开发者ID:safaricco,项目名称:imocooer,代码行数:39,代码来源:Contato.php

示例11: postAddIntrare

 public function postAddIntrare()
 {
     $rules = array('expeditor' => 'required', 'destinatar' => 'required');
     $errors = array('required' => 'Campul este obligatoriu.');
     $validator = Validator::make(Input::all(), $rules, $errors);
     if ($validator->fails()) {
         return Redirect::back()->with('message', 'Eroare validare formular!')->withErrors($validator)->withInput();
     } else {
         DB::beginTransaction();
         try {
             $numar_inregistrare = DB::table('registru_intrare')->select(DB::raw('max(numar_inregistrare) AS numar_inregistrare'))->where('logical_delete', 0)->get();
             $urmatorul_numar_inregistrare = 0;
             if ($numar_inregistrare[0]->numar_inregistrare > 0) {
                 $urmatorul_numar_inregistrare = $numar_inregistrare[0]->numar_inregistrare;
             }
             $urmatorul_numar_inregistrare++;
             DB::table('registru_intrare')->insertGetId(array('numar_inregistrare' => $urmatorul_numar_inregistrare, 'expeditor' => Input::get('expeditor'), 'numar_inregistrare_expeditor' => Input::get('numar_inregistrare_expeditor'), 'numar_anexe' => Input::get('numar_anexe'), 'continut' => Input::get('continut'), 'destinatar' => Input::get('destinatar'), 'observatii' => Input::get('observatii')));
         } catch (Exception $e) {
             DB::rollback();
             return Redirect::back()->with('message', 'Eroare salvare date: ' . $e)->withInput();
         }
         DB::commit();
         return Redirect::back()->with('message', 'Salvare realizata cu succes!');
     }
 }
开发者ID:binaryk,项目名称:lareab,代码行数:25,代码来源:RegistruIntrareController.php

示例12: destroy

 /**
  * Unfollow a user
  * Remove the specified resource from storage.
  *
  * @param  $idOfUserToUnfollow
  * @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:HinchK,项目名称:xtpg-larabook,代码行数:14,代码来源:FollowsController.php

示例13: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $validation = Validator::make($request->all(), ['nome' => 'required|string', 'data' => 'required|date', 'hora' => 'required|string', 'profissional' => 'required|string', 'imagem' => 'image|mimes:jpeg,bmp,png,jpg']);
     if ($validation->fails()) {
         return redirect('admin/destaques/novo')->withErrors($validation)->withInput();
     } else {
         try {
             $destaque = new Destaque();
             $destaque->nome = $request->nome;
             $destaque->data = date('Y-m-d', strtotime($request->data));
             $destaque->hora = $request->hora;
             $destaque->profissional = $request->profissional;
             $destaque->save();
             // FAZENDO O UPLOAD E GRAVANDO NA TABELA MULTIMIDIA / VERIFICANDO SE O ARQUIVO N�O EST� CORROMPIDO
             if ($request->hasFile('imagem')) {
                 Midia::uploadUnico($this->tipo_midia, $destaque->id_destaque);
             }
             session()->flash('flash_message', 'Banners cadastrada com sucesso!');
         } catch (\Exception $e) {
             LogR::exception($destaque, $e);
             session()->flash('flash_message', 'Ops!! Ocorreu algum problema!. ' . $e->getMessage());
         }
         return Redirect::back();
     }
 }
开发者ID:safaricco,项目名称:imocooer,代码行数:31,代码来源:Destaques.php

示例14: save_asignar

 public function save_asignar(Request $request)
 {
     $m = Materia::find($request->materia);
     $m->id_docente = $request->docente;
     $m->save();
     return Redirect::back()->with(['success' => ' ']);
 }
开发者ID:TeDyGuN,项目名称:sisoretti,代码行数:7,代码来源:AcademicoController.php

示例15: convertGems

 public function convertGems(convertFormRequest $request)
 {
     // Get user id from form
     $id = $request->id;
     $user = User::find($id);
     // Get amount of gems to convert
     $gemsAmount = $request->gemsAmount;
     if ($user->gems >= $gemsAmount) {
         // Convert gems to money
         $converted = $gemsAmount / 100;
         // Saves new values in database
         $user->gems = $user->gems - $gemsAmount;
         $user->money = $user->money + $converted;
         $user->save();
         // Create transaction record
         $transaction = new Transactions();
         $transaction->user_id = $id;
         $transaction->username = $user->username;
         $transaction->status = 'CONVERT';
         $transaction->amount = $gemsAmount;
         $transaction->value = 'GEMS';
         $transaction->result = $converted;
         $transaction->result_value = 'POUNDS';
         $transaction->save();
         return Redirect::back()->with('convertSuccessMessage', 'You successfully converted ' . $gemsAmount . ' Gems to £' . number_format($converted, 2) . '!');
     } else {
         return Redirect::back()->with('convertErrorMessage', 'You do not have the required funds to make that conversion.');
     }
 }
开发者ID:Amphios,项目名称:stunning-temple,代码行数:29,代码来源:ProfileController.php


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