D
D
Dmitry2018-02-23 17:18:16
Laravel
Dmitry, 2018-02-23 17:18:16

How to fix the problem with an empty $errors variable on hosting?

Greetings! I am actively mastering Laravel 5.5 and have encountered a problem that I have not been able to solve on my own yet.
Validation of forms in the admin panel is done using the FormRequest. Everything is fine on the local machine, but on the hosting the $errors variable is empty, so validation errors are not displayed. Any ideas what could be the reason?

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ForecastForm extends FormRequest
{
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        return [
            'img' => 'required|image',
            'name' => 'required'
        ];
    }

    public function messages()
    {
        return [
            'img.required' => 'Загузите изображение',
            'img.image' => 'Загруженный файл должен быть в формате jpeg, png, bmp, gif или svg',
            'name.required' => 'Поле "Название" обязательно для заполнения'
        ];
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JhaoDa, 2018-02-23
@krsdm

There is an idea. Error transmission works through what? That's right, through sessions. Continue further?
Upd: the problem turned out to be in cookies.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question