I am trying to add messages error in every validation variable, searching and find this withValidator
// AccountRequest.php
public function withValidator($validator)
{
$validator->after(function ($validator) {
if ($this->request->has('modal') && $validator->fails()) {
$validator->errors()->add('modal', $this->request->get('modal'));
}
});
}
The problem is everytime this code $validator->fails()
running, my local server got so slow, and crash, even thought the $request
is just 2 data
What I have done so far is, changing the server from using php artisan serve
to apache
This is error on apache log
[Sat Oct 29 21:02:42.135270 2022] [php:error] [pid 30872:tid 1896] [client 127.0.0.1:61836] PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0
Thanks In Advance
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community