fixed browse and tailwindcss style
This commit is contained in:
@@ -53,24 +53,11 @@ class PhotographyController extends Controller
|
||||
$tidy = $category->description ?? ($ct->description ?? null);
|
||||
|
||||
$perPage = 40;
|
||||
$sort = (string) $request->get('sort', 'latest');
|
||||
|
||||
// Load artworks for the requested content type using standard pagination
|
||||
try {
|
||||
$artQuery = \App\Models\Artwork::public()
|
||||
->published()
|
||||
->whereHas('categories', function ($q) use ($ct) {
|
||||
$q->where('categories.content_type_id', $ct->id);
|
||||
})
|
||||
->with([
|
||||
'user:id,name',
|
||||
'categories' => function ($q) {
|
||||
$q->select('categories.id', 'categories.content_type_id', 'categories.parent_id', 'categories.name', 'categories.slug', 'categories.sort_order')
|
||||
->with(['parent:id,parent_id,content_type_id,name,slug', 'contentType:id,slug,name']);
|
||||
},
|
||||
])
|
||||
->orderByDesc('published_at');
|
||||
|
||||
$artworks = $artQuery->paginate($perPage)->withQueryString();
|
||||
$artworks = $this->artworks->getArtworksByContentType($contentSlug, $perPage, $sort);
|
||||
} catch (\Throwable $e) {
|
||||
// Return an empty paginator so views using ->links() / ->firstItem() work
|
||||
$artworks = new \Illuminate\Pagination\LengthAwarePaginator([], 0, $perPage, 1, [
|
||||
|
||||
Reference in New Issue
Block a user