B
B
Barney_Gubmle2019-02-06 21:46:06
Laravel
Barney_Gubmle, 2019-02-06 21:46:06

Why can a validator return a blank page?

Good evening. There is an input for photos
Validator:

$this->validate($request, [
       'photo' => 'image'
]);

And when the validator passes this part, if the file is not an image, nothing happens.
Those. it just leaves a white box.
No return to the previous page, nothing.
How to fix? I did not find any information about "return to a blank page" on the Internet
UPD 22:06 (MSK)
I call a white window, I go back - the previous one appears with the necessary inputs and with an
error after the file does not pass validation - it freezes, but does not come back.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Barney_Gubmle, 2019-02-07
@Barney_Gubmle

The solution is found, it can be useful to someone.
The day before I was tinkering with:

App\Exception\Handler


  public function render($request, Exception $exception)
    {
        if ($exception instanceof CustomException) {
            return response()->view('errors.custom', [], 500);
        }

        return parent::render($request, $exception);
    }

Because of my own asshole, I made mistakes for myself. I'll leave it here, you never know, someone else will find the same.

N
netrox, 2019-02-06
@netrox

https://laravel.com/docs/5.7/validation#quick-disp...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question