本文整理汇总了PHP中Illuminate\Support\Facades\Session::keep方法的典型用法代码示例。如果您正苦于以下问题:PHP Session::keep方法的具体用法?PHP Session::keep怎么用?PHP Session::keep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Session
的用法示例。
在下文中一共展示了Session::keep方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
public function create()
{
if (Session::has('backTo')) {
Session::keep('backTo');
}
// pass it forward
return view('trigger.create');
}
示例2: create
public function create()
{
// keep backtrack token in the session one more step of the way.
if (Session::has('backTo')) {
Session::keep('backTo');
} else {
Session::flash('backTo', Request::fullUrl());
}
return view('medicine.create');
}
示例3: edit
public function edit(Journal $journal)
{
// keep backtrack token in the session one more step of the way.
if (Session::has('backTo')) {
Session::keep('backTo');
} else {
Session::flash('backTo', Request::fullUrl());
}
$journal = $journal->load('triggers');
// Create list with name=>id to use in select2 field.
$triggers = Auth::user()->triggers()->lists('name', 'id');
$medicines = Auth::user()->medicines()->lists('name', 'id');
$common_triggers = CommonTriggers::all()->lists('name', 'id');
// $pain_locations = PainLocations::all()->lists('name', 'id');
return view('journal.edit', compact('journal', 'common_triggers', 'triggers', 'medicines'));
}
示例4: getLoginWithGithub
/**
* Handle Github login.
*
* @return \Illuminate\Http\RedirectResponse
*/
public function getLoginWithGithub()
{
if (!Input::has('code')) {
Session::keep(['url']);
GithubProvider::authorize();
} else {
try {
$user = Github::register(Input::get('code'));
Auth::login($user);
if (Session::get('password_required')) {
return $this->redirectRoute('user.settings', [], ['update_password' => true]);
}
return $this->redirectIntended(route('user.index'));
} catch (GithubEmailNotVerifiedException $e) {
return $this->redirectRoute('auth.register', ['github_email_not_verified' => true]);
}
}
}
示例5: getRegistration
/**
* If present, returns the RegisterInfoInterface which lets you access the account data
*
* @return RegisterInfoInterface|null
*/
public function getRegistration()
{
Session::keep(self::REGISTER_INFO_SESSION);
return Session::get(self::REGISTER_INFO_SESSION);
}