You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alert title and message blank when using redirect()-back()->withErrors($validator). Perhaps I am doing this wrong? I would like to skip the usage of Middleware if possible. See the image below:
Package Version: 2.0.5 Laravel Version: 6.18.41
Steps to Reproduce
Use a validator() helper to validate $request.
On validator()->fails(), call alert() helper. (Usage of alert() helper of the SweetAlert facade does not matter as neither works.)
Use redirect()-back()->withErrors($validator) after alert() helper.
Sample Code
public function store(Request $request)
{
$validator = validator()->make($request->all(), [
'name' => 'required|string'
]);
if($validator->fails()) {
alert()->error(__('Please check your entries and submit again.'), __('Invalid Submission'))->persistent('OK');
return redirect()->back()
->withInput()
->withErrors($validator);
}
// ...
}
The text was updated successfully, but these errors were encountered:
Upon inspection, I noticed that this empty popup will appear every time I use withErrors() even without calling alert(). This will also cause the blank popup:
Description
Alert title and message blank when using
redirect()-back()->withErrors($validator)
. Perhaps I am doing this wrong? I would like to skip the usage of Middleware if possible. See the image below:Package Version: 2.0.5
Laravel Version: 6.18.41
Steps to Reproduce
validator()
helper to validate$request
.validator()->fails()
, callalert()
helper. (Usage ofalert()
helper of theSweetAlert
facade does not matter as neither works.)redirect()-back()->withErrors($validator)
afteralert()
helper.Sample Code
The text was updated successfully, but these errors were encountered: