FilamentF
Filamentโ€ข9mo ago
LarrySD

Implement a Cluster with a Custom Page for a Specific Model

Hey everyone! ๐Ÿ‘‹

I'm working on a project where I need to set up a Cluster for a specific model (let's call it Project), and I'm a bit unsure about the right way to structure the routes for a nested page.

๐Ÿ”ง Context:


  • I have a Project model, and each project is accessible via a slug (e.g. /my-cool-project).
  • I want to create a Cluster around this model so that each project acts like a cluster root.
  • Inside this cluster, I need a custom page called settings, so that the full path looks like:
    /{project-slug}/settings
### โ“ My Questions:

  1. Should this path ({project-slug}/settings) be registered via routes.php, or should it be part of the discoverCluster setup?
  2. How do I properly link this custom page to the cluster so it respects the project context (e.g., fetching the correct project based on slug)?
  3. Are there any best practices for structuring custom cluster pages like settings under a model-driven path like this?
  4. If I want to include additional pages in the future like /edit, /analytics, etc., should those also live under the same cluster or be managed differently?
### ๐Ÿงช What Iโ€™ve Tried:
  • I looked into discoverCluster usage but it seems limited in terms of defining nested pages.
  • Attempted adding it directly to the routes config, but it doesn't seem to automatically respect the model context unless I manually fetch the Project by slug.
Would love any pointers, examples, or even snippets if youโ€™ve done something similar ๐Ÿ™ Thanks in advance!
Was this page helpful?