本文整理汇总了PHP中Illuminate\Support\Facades\Redirect::Back方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::Back方法的具体用法?PHP Redirect::Back怎么用?PHP Redirect::Back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Redirect
的用法示例。
在下文中一共展示了Redirect::Back方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postConnexion
/**
* Store a newly created resource in storage.
*
* @Post("/connecter")
* @return Redirect
*/
public function postConnexion(Request $request)
{
/*return json_encode(Auth::attempt(['email' => $request->email, 'password' => $request->pwd]));*/
if (Auth::attempt(['email' => $request->email, 'password' => $request->pwd])) {
return redirect()->intended('/');
} else {
return Redirect::Back();
}
/*return json_encode(Auth::attempt(['email' => Input::get('email'), 'password' => Input::get('password')]));*/
}
示例2: getEditable
public function getEditable($decleration_id, $field_name)
{
if (!Auth::user() || Auth::user()->role == 100) {
Redirect::to('/')->send();
}
$editable = Editable::checkIfEditable($decleration_id, $field_name);
if ($editable) {
Editable::deleteEditable($decleration_id, $field_name);
} else {
Editable::create(['decleration_id' => $decleration_id, 'field_name' => $field_name]);
}
return Redirect::Back();
}
示例3: reset_password
public function reset_password(Request $request)
{
$this->validate($request, ['email' => 'required'], ['email.required' => 'იმეილი სავალდებულოა', 'email.email' => 'არასწორი იმეილი']);
$email = Input::get('email');
$user = User::where('email', $email)->first();
$password = str_random(8);
$user->update(['password' => $password]);
$payload = ['user_name' => $user->first_name . ' ' . $user->last_name, 'password' => $password];
Mail::send('email.reset_password', $payload, function ($m) use($email) {
$m->from('lsg.gov.ge@gmail.com', 'Edu lsg gov');
$m->to($email)->subject('Password reset');
});
return Redirect::Back();
}