本文整理匯總了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();
}