I'm using laravel clockwork to monitor my queries
in my controller I have
public function index(){
$errorFound = false;
$error = ['error' => 'No Monitor Found'];
$urls = $this->url->with('url_status','latestUrlStatus','users');
if (request()->has('q')) {
$keyword = '%'.request()->get('q').'%';
$builder = $urls->where('description', 'like', $keyword);
$builder->count() ? $urls = $builder : $errorFound = true;
}
return $errorFound === false ? UrlsResource::collection($urls->latest()->paginate(5)->appends(request()->query())) : $error;
}
on my laravel clockwork im getting doubled queries
is it normal? if it is a problem how can I fix this? TIA
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire