Skip to content

fix(collections): hide draft collections from public browse surfaces#796

Open
vcnainala wants to merge 4 commits into
developmentfrom
fix/hide-draft-collections-from-public-pages
Open

fix(collections): hide draft collections from public browse surfaces#796
vcnainala wants to merge 4 commits into
developmentfrom
fix/hide-draft-collections-from-public-pages

Conversation

@vcnainala

@vcnainala vcnainala commented Jun 1, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds a reusable published() query scope on Collection plus a published() factory state for tests and fixtures.
  • Applies that scope on public entry points: /collections (Livewire), homepage featured collections, collection identifier redirects, and Lomkit REST collection search.
  • Adds a feature test ensuring draft collections never appear on the browse page.

Test plan

  • php artisan test --filter=CollectionListTest
  • Visit /collections and confirm only PUBLISHED collections are listed
  • Confirm a DRAFT collection with a CNPC… identifier returns 404 at /collections/{identifier}
  • Confirm promoted homepage collections exclude drafts
  • Confirm Filament dashboard collection management still lists draft and published presets

Resolves

Closes #774

vcnainala added 3 commits June 1, 2026 19:43
Introduce a reusable published() scope on Collection and a matching
factory state so public queries and tests can target published records
consistently.
Apply the published scope on the collections page, homepage featured
collections, identifier redirects, and REST search so DRAFT collections
are not exposed outside the dashboard.
Add a feature test that verifies draft collections are excluded from
/collections and from the CollectionList Livewire component.
@codecov-commenter

codecov-commenter commented Jun 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 15.78947% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 6.35%. Comparing base (4223a58) to head (7058097).

Files with missing lines Patch % Lines
app/Rest/Resources/CollectionResource.php 0.00% 8 Missing ⚠️
app/Livewire/DataSources.php 0.00% 7 Missing ⚠️
app/Http/Controllers/CollectionController.php 0.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##             development    #796      +/-   ##
================================================
+ Coverage           6.13%   6.35%   +0.21%     
- Complexity          1737    1740       +3     
================================================
  Files                227     227              
  Lines               8961    8971      +10     
================================================
+ Hits                 550     570      +20     
+ Misses              8411    8401      -10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Use where() instead of the published() scope because Lomkit REST
builders are typed as the Eloquent contract interface, which PHPStan
does not resolve to model-specific query scopes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants