本文整理汇总了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');
}
示例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("/");
}
示例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");
}
示例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.');
}
示例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();
}
示例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);
}
示例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();
}
示例8: select
public function select($ticketId, $commentId)
{
$ticket = $this->ticketRepository->findOrFail($ticketId);
$this->authorize('selectResource', $ticket);
$ticket->assignResource($commentId);
return Redirect::back();
}
示例9: switchLang
public function switchLang($lang)
{
if (array_key_exists($lang, Config::get('languages'))) {
Session::set('applocale', $lang);
}
return Redirect::back();
}
示例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!');
}
}
示例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);
}
示例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');
}
示例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', 'Неверное имя пользователя и/или пароль!');
}
示例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');
}
}
示例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();
}