Запретить перезагрузку формы страницы после перенаправления Laravel ⇐ Php
-
Anonymous
Запретить перезагрузку формы страницы после перенаправления Laravel
I am implementing account verification and part of it is resending email verification.
Blade
id }}">@lang('localization.clickHere')@lang('localization.toResendEmail') routes/web
Route::get('register/resend/{id}','Auth\VerificationController@resend'); Controller
public function resend($id, Request $request) { $user = User::where('id',$id)->firstOrFail(); Mail::to($user->email)->queue(new ConfirmRegistration($user)); $messenger = new Messenger($user); $messenger->sendSuccess(__(trans('localization.emailSentSuccessfully'))); return back(); } The issue I am having is that the page reloads (as expected) whenever I trigger the href, which leads to the message sent by the Controller disappear right away.
Is there a way to prevent the page from reloading but still trigger the route? I tried adding onclick="return false;" but that seems to prevent resend function from running.
Источник: https://stackoverflow.com/questions/480 ... te-laravel
I am implementing account verification and part of it is resending email verification.
Blade
id }}">@lang('localization.clickHere')@lang('localization.toResendEmail') routes/web
Route::get('register/resend/{id}','Auth\VerificationController@resend'); Controller
public function resend($id, Request $request) { $user = User::where('id',$id)->firstOrFail(); Mail::to($user->email)->queue(new ConfirmRegistration($user)); $messenger = new Messenger($user); $messenger->sendSuccess(__(trans('localization.emailSentSuccessfully'))); return back(); } The issue I am having is that the page reloads (as expected) whenever I trigger the href, which leads to the message sent by the Controller disappear right away.
Is there a way to prevent the page from reloading but still trigger the route? I tried adding onclick="return false;" but that seems to prevent resend function from running.
Источник: https://stackoverflow.com/questions/480 ... te-laravel
Мобильная версия