Answer the question
In order to leave comments, you need to log in
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question