當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Facades\Redirect類代碼示例

本文整理匯總了PHP中Illuminate\Support\Facades\Redirect的典型用法代碼示例。如果您正苦於以下問題:PHP Redirect類的具體用法?PHP Redirect怎麽用?PHP Redirect使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Redirect類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: handleFbCallback

 public function handleFbCallback()
 {
     $fb_user = Socialite::driver('facebook')->user();
     $user = User::firstOrCreate(['firstname' => $fb_user->user['first_name'], 'lastname' => $fb_user->user['last_name'], 'email' => $fb_user->email]);
     Auth::login($user, true);
     return Redirect::to('/books');
 }
開發者ID:a1ex7,項目名稱:librauth,代碼行數:7,代碼來源:AuthController.php

示例2: logout

 public function logout()
 {
     $seguranca = new DPRFSeguranca(config("PRF.siglaSistema"), config("PRF.producao"));
     $seguranca->auditoria(Auth::user()->cpf, "LOGOUT", "Logout", array());
     Auth::logout();
     return Redirect::to("/");
 }
開發者ID:vlamirc,項目名稱:arquetipophp,代碼行數:7,代碼來源:LoginController.php

示例3: update

 public function update()
 {
     $profile = Profile::where('user_id', Auth::user()->id)->first();
     $profile->fill(Input::all());
     $profile->save();
     return Redirect::to("/edit_profile");
 }
開發者ID:Volkan61,項目名稱:begreat,代碼行數:7,代碼來源:ProfileController.php

示例4: logar

 public function logar(Request $request)
 {
     $regras = array('email' => 'required|string', 'password' => 'required');
     $mensagens = array('required' => 'O campo :attribute deve ser preenchido.');
     $this->validate($request, $regras, $mensagens);
     $email = $request['email'];
     $senha = $request['password'];
     $condicao = ['email' => $email];
     $remember = !empty($request['remember']) ? true : false;
     if (Auth::attempt(['email' => $email, 'password' => $senha], $remember)) {
         if ($this->authorize('logar', $email, $senha)) {
             return Redirect::action('LoginController@index');
         }
     }
     //        if(!empty($usuario) && Hash::check($senha,$usuario->password))
     //        {
     //                Auth::loginUsingId($usuario->id);
     //
     //            if($this->authorize('logar',$email,$senha))
     //            {
     //                return redirect('Empresa');
     //            }
     //        }
     return redirect()->back()->withErrors('Usuário inválido.');
 }
開發者ID:renanpupin,項目名稱:brasilspot,代碼行數:25,代碼來源:LoginController.php

示例5: destroy

 public function destroy($id)
 {
     $user = $this->model->findOrFail($id);
     $this->userRepository->deleteUser($user);
     flash()->success(trans('LaravelAdmin::laravel-admin.userDeleted'));
     return Redirect::back();
 }
開發者ID:shinichi81,項目名稱:laravel-admin,代碼行數:7,代碼來源:UsersController.php

示例6: restore

 public function restore($id)
 {
     $specificUser = User::withTrashed()->find($id);
     $specificUser->restore();
     $users = User::where('admin1_user0', '=', 0)->withTrashed()->get();
     return Redirect::to('dashboard')->with('users', $users);
 }
開發者ID:jimpeeters,項目名稱:Win4LifeBonus,代碼行數:7,代碼來源:UserController.php

示例7: store

 public function store(LocationRequest $request)
 {
     $location = Location::create($request->all());
     Session::flash('success', true);
     Session::flash('message', 'Aðgerð tókst: Ný staðsetning');
     return Redirect::back();
 }
開發者ID:birgirob,項目名稱:TiSDaV,代碼行數:7,代碼來源:LocationController.php

示例8: 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

示例9: switchLang

 public function switchLang($lang)
 {
     if (array_key_exists($lang, Config::get('languages'))) {
         Session::set('applocale', $lang);
     }
     return Redirect::back();
 }
開發者ID:Ristop,項目名稱:valgeranna,代碼行數:7,代碼來源:LanguageController.php

示例10: 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

示例11: handle

 /**
  * Handle an incoming request, check to see if we have a redirect in place for the requested URL
  * and then redirect if we do have a match
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     // Get the full URL that has been requested, minus the protocol
     $full_url = str_replace($request->getScheme() . "://", "", $request->url());
     // Check for any results matching the full domain request
     $results = Redirect::where("type", "domain")->where("from", $full_url)->where("status", "active");
     if ($results->exists()) {
         // Get the first result back
         $redirect = $results->first();
         // Grab the URL before we increment
         $url = $redirect->to;
         // Increment the hit count
         $redirect->increment('hits');
         // Redirect off to where we're going
         return RedirectFacade::to($url);
     }
     // Check for any results matching the path only
     $results = Redirect::where("type", "path")->where("from", "/" . $request->path())->where("status", "active");
     // If a redirect exists for this, process it and redirect
     if ($results->exists()) {
         // Get the first result back
         $redirect = $results->first();
         // Grab the URL before we increment
         $url = $redirect->to;
         // Increment the hit count
         $redirect->increment('hits');
         // Redirect off to where we're going
         return RedirectFacade::to($url, 301);
     }
     // By default, continue afterwards and bail out
     return $next($request);
 }
開發者ID:ssx,項目名稱:threeohone,代碼行數:40,代碼來源:CheckForRedirect.php

示例12: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateTratamientoRequest $request)
 {
     $tratamiento = Tratamiento::create($request->all());
     $message = $tratamiento->nombre_tratamiento . ' fue creado correctamente';
     Session::flash('message', $message);
     return Redirect::route('admin.tratamiento.index');
 }
開發者ID:panxox1323,項目名稱:Oral_Plus2,代碼行數:13,代碼來源:TratamientoController.php

示例13: login

 protected function login()
 {
     if (auth()->attempt(array('email' => Input::get('email'), 'password' => Input::get('password')), true) || auth()->attempt(array('name' => Input::get('email'), 'password' => Input::get('password')), true)) {
         return Redirect::intended('/');
     }
     return back()->withInput()->with('message', 'Неверное имя пользователя и/или пароль!');
 }
開發者ID:Anatoly38,項目名稱:proj01.laravel,代碼行數:7,代碼來源:AuthController.php

示例14: TambahJadwal

 public function TambahJadwal()
 {
     $rules = array('unit_id' => 'required', 'kategori' => 'required', 'tglstart' => 'required', 'tglases' => 'required', 'tglfinish' => 'required', 'detail' => 'required');
     $messages = array('unit_id.required' => 'Nama Jabatan Harus Terisi', 'kategori.required' => 'Kategori Harus Dipilih', 'tglstart.required' => 'Tanggal Mulai Harus Terisi', 'tglases.required' => 'Tanggal Asessment Harus Terisi', 'tglfinish.required' => 'Tanggal Selesai Harus Terisi', 'detail.required' => 'Detail Harus terisi');
     $validasi = validator::make(Input::all(), $rules, $messages);
     if ($validasi->fails()) {
         return Redirect::back()->withErrors($validasi)->withInput();
     } else {
         $kat = Input::get('kategori');
         if ($kat == 'internal') {
             $aa = "in";
         } else {
             $aa = "ex";
         }
         DB::transaction(function ($aa) use($aa) {
             //asesment promosi
             $jadwal = KandidatPromote::create(['unit_staf_id' => Input::get('unit_id'), 'tgl_awal' => Input::get('tglstart'), 'tgl_asesment' => Input::get('tglases'), 'tgl_selesai' => Input::get('tglfinish'), 'detail' => Input::get('detail')]);
             //rekrutmen rekap header
             $rekap_header = HeaderRekap::create(['id_asesmen' => $jadwal->id, 'kategori' => Input::get('kategori'), 'nama' => Input::get('jabatan'), 'tanggal_awal' => Input::get('tglstart'), 'tanggal_akhir' => Input::get('tglfinish'), 'deksripsi' => Input::get('detail')]);
             //asessment promosi daftar
             $daftar = KandidatPromosiDaftar::create(['asesment_promosi_id' => $jadwal->id, 'nip' => Input::get('nip'), 'detail' => Input::get('detail')]);
             //rekrutment rekap profiling
             $profil = ProfilingRekap::create(['id_rekap' => $rekap_header->id, 'kategori' => $aa, 'nip' => $daftar->nip, 'id_jabatan' => $jadwal->unit_staf_id]);
         });
         Session::flash('message', 'Berhasil Menambahkan Jadwal Asessment');
         return Redirect::to('career/jadwal/lihat/asessment');
     }
 }
開發者ID:hendrilara,項目名稱:kemenpan,代碼行數:28,代碼來源:KandidatPromosiController.php

示例15: 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


注:本文中的Illuminate\Support\Facades\Redirect類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。