Simplify course search functionality and update route names for clarity
This commit is contained in:
@@ -217,10 +217,7 @@ class ProgramController extends Controller
|
||||
}
|
||||
|
||||
if ($request->filled('search')) {
|
||||
$query->where(function ($q) use ($request) {
|
||||
$q->where('keywords', 'like', "%{$request->search}%")
|
||||
->orWhere('title', 'like', "%{$request->search}%");
|
||||
});
|
||||
$query->where('title', 'like', "%{$request->search}%");
|
||||
}
|
||||
|
||||
if ($request->filled('programlevels_id')) {
|
||||
|
@@ -23,7 +23,7 @@ class ProgramService
|
||||
|
||||
if ($request->filled('intake_id')) {
|
||||
$intakeId = $request->intake_id;
|
||||
$query->whereJsonContains('intake', $intakeId);
|
||||
$query->whereJsonContains('intakes', $intakeId);
|
||||
}
|
||||
|
||||
if ($request->filled('status')) {
|
||||
@@ -32,14 +32,13 @@ class ProgramService
|
||||
|
||||
if ($request->filled('search')) {
|
||||
$search = $request->search;
|
||||
$query->where('keywords', 'like', "%{$search}%");
|
||||
$query->where('title', 'like', "%{$search}%");
|
||||
}
|
||||
|
||||
if ($request->filled('location')) {
|
||||
$location = $request->location;
|
||||
$query->where('location', 'like', "%{$location}%");
|
||||
}
|
||||
|
||||
})->latest()->paginate(10)->withQueryString();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user