I filter job offers on data from a database. As long as the table contained up to 10,000 records, everything worked great.
$searchQuery = \App\JobOffers::searchOffer($search_text, $search_location, $job_function, $job_type, $job_experience, $date_filter, $last);
Now the table has over 60,000 records with job offers. When I wants to perform filtering, the application returns error 500.
I can't find a solution to this problem.
I thought about using 'chunk'. I don't know if this solution will help.
foreach ($all->chunk(100) as $key => $chunk) {
$chunk = $chunk->all();
$test = $chunk::searchOffer($search_text, $search_location, $job_function, $job_type, $job_experience, $date_filter, $last);
$searchQuery->push($test);
}
In the above example I get an error: "Class name must be a valid object or a string".
Is there any way to solve this problem?