Skip to content

Hide "pages" page in filament panel#20

Merged
chasecmiller merged 2 commits intoCrumbls:mainfrom
TheGodlyLuzer:feat/admin-page-hidden
May 1, 2026
Merged

Hide "pages" page in filament panel#20
chasecmiller merged 2 commits intoCrumbls:mainfrom
TheGodlyLuzer:feat/admin-page-hidden

Conversation

@TheGodlyLuzer
Copy link
Copy Markdown
Contributor

@TheGodlyLuzer TheGodlyLuzer commented Mar 16, 2026

This PR allows users to hide the "pages" resource from their admin panels. In some cases (e.g when the user only wants to render the LayupContent from a model) the "pages" resource is not needed.

Summary by CodeRabbit

  • New Features

    • Pages feature can now be conditionally enabled or disabled via configuration, allowing administrators to control whether the Pages resource appears in the admin panel.
  • Documentation

    • Updated configuration documentation to explain the new enabled option and its behavior.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4df14f5d-a4db-415b-8b41-bcb5de59efb0

📥 Commits

Reviewing files that changed from the base of the PR and between 26adb0e and 19618a3.

📒 Files selected for processing (3)
  • config/layup.php
  • docs/configuration.md
  • src/LayupPlugin.php
✅ Files skipped from review due to trivial changes (1)
  • docs/configuration.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/layup.php

📝 Walkthrough

Walkthrough

A configuration flag is added to conditionally enable or disable the Pages feature. The LayupPlugin now checks this config value before registering the PageResource to the Filament admin panel, and the documentation is updated to describe this new option.

Changes

Cohort / File(s) Summary
Configuration & Plugin
config/layup.php, src/LayupPlugin.php
Added 'enabled' => true config option to pages configuration and implemented conditional PageResource registration based on layup.pages.enabled flag in the plugin boot sequence.
Documentation
docs/configuration.md
Documented the new enabled boolean option for the pages configuration, explaining that it controls admin panel resource registration while leaving frontend rendering unaffected.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A switch to toggle Pages on and off,
No need to scoff at this simple loft!
When enabled is true, the UI takes flight,
When false, the database still shines so bright! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding an option to conditionally hide the 'pages' resource from the Filament admin panel via a configuration toggle.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 PHPStan (2.1.51)

PHPStan was skipped because the sandbox runner could not parse its output.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@chasecmiller
Copy link
Copy Markdown
Contributor

Hey @TheGodlyLuzer just a heads up that I see this. I have one other package that requires this to be there. I'm workin on decoupling it right now. Hoping to really review this today/tonight.

@TheGodlyLuzer
Copy link
Copy Markdown
Contributor Author

Hi @chasecmiller, any updates on this? :)

@chasecmiller chasecmiller force-pushed the feat/admin-page-hidden branch from 26adb0e to 19618a3 Compare May 1, 2026 06:50
@chasecmiller
Copy link
Copy Markdown
Contributor

Hey @TheGodlyLuzer, thanks for the contribution! I rebased your branch onto current main to clear the conflicts:

  • config/layup.php -- your 'enabled' => true, line slotted in next to the new 'default_slug' and 'max_depth' keys that landed on main since you opened the PR.
  • src/LayupPlugin.php -- unchanged from your patch, still wraps PageResource registration in if (config('layup.pages.enabled', true)).
  • README.md -- the README was rewritten on main while this PR was open and now points at the docs site rather than carrying full config docs. Your documentation prose moved to docs/configuration.md (the new home for config docs) under the ## Pages section, where it now reads as a proper config bullet right next to the existing table / model / default_slug entries.

Authorship on both commits is preserved as yours. Force-push was via maintainerCanModify. Diff vs main is just the three small files above; full test suite (1168 tests) passes locally. Ready to merge from our side.

@chasecmiller chasecmiller merged commit a324a3d into Crumbls:main May 1, 2026
2 checks passed
@chasecmiller
Copy link
Copy Markdown
Contributor

Sorry, I had to get a lot of this updated. Thanks for your work!

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