whereAny(['title'], 'LIKE', "%$search%"); } if (isset($filters["status"])) { $query->where("status", $filters["status"]); } if (isset($filters["date"])) { $explodeDate = explode("to", $filters['date']); // dd($filters['date'], preg_replace('/\s+/', '', $explodeDate[1])); $query->whereBetween("start_date", [$explodeDate[0], preg_replace('/\s+/', '', $explodeDate[1])]); } })->get(); } public function getTaskById($TaskId) { return Task::findOrFail($TaskId); } public function delete($TaskId) { Task::destroy($TaskId); } public function create($TaskDetails) { return Task::create($TaskDetails); } public function update($TaskId, array $newDetails) { return Task::whereId($TaskId)->update($newDetails); } public function pluck() { return Task::pluck(DB::raw('CONCAT(first_name," ", middle_name , " ",last_name) AS full_name'), 'id'); } }