Skip to main content

Claude/ChatGPT Prompt to Build a Filament 3 Resource With a Custom Page

Build a Filament 3 admin resource — list with filters, forms, a custom bulk-import page, a stats widget, and RBAC via Shield — for any model.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt
You are a senior Laravel and Filament engineer. Build a complete Filament 3 resource for Customer. Return working code, not pseudocode.

Context:
- Model: Customer
- Key columns: name, email, plan, created_at, status
- Import source: a CSV upload
- Roles allowed: admin and support-manager

Deliverables:
1. A list page with columns from name, email, plan, created_at, status, searchable/sortable, plus table filters and row actions.
2. Create and edit forms with validation, sensible field types, and helper text.
3. A custom page for bulk import from a CSV upload, with a dry-run preview before commit.
4. A dashboard stats widget summarizing the model (counts, trend, one key metric).
5. RBAC via Filament Shield so only admin and support-manager can access each action.
6. Registration steps: provider wiring, navigation group, and policy hooks.

Return the resource file, the custom page, the widget, and the registration steps, each fenced and copy-ready.

What this prompt does

This prompt directs the AI to build a complete Filament 3 admin resource for a model you name, returning working code instead of pseudocode. You supply [model], the [key_columns] to surface, the [import_source] for bulk import, and the [roles] allowed to manage it. The AI then produces a list page, create/edit forms, a custom bulk-import page with a dry-run preview, a dashboard stats widget, RBAC via Filament Shield, and the registration steps.

The six-deliverable structure works because a real admin panel is more than CRUD scaffolding — it needs filters, safe bulk operations, and access control. By making the AI generate a dry-run import and Shield-based RBAC up front, the prompt produces a back office that is usable and safe on day one. [key_columns] shapes the list page columns and which fields are searchable and sortable. [import_source] decides the import UI (a CSV upload behaves differently from an API pull), and [roles] wires which users can reach each action.

When to use it

  • You're scaffolding a new Filament resource and want filters, forms, and RBAC in one pass.
  • You need a bulk-import page that previews changes before committing them.
  • You want a dashboard stats widget summarizing a model without hand-writing it.
  • You're enforcing role-based access with Filament Shield and want it wired correctly.
  • You keep forgetting the provider wiring and navigation registration steps.
  • You're building a client back office and need it to feel real, not like a CRUD demo.

Example output

You get several copy-ready code blocks: the resource file with a searchable, sortable list page including table filters and row actions; create and edit forms with validation, sensible field types, and helper text; a custom page implementing bulk import from [import_source] with a dry-run preview before commit; a dashboard widget showing counts, a trend, and one key metric; Shield RBAC limiting actions to [roles]; and the registration steps covering provider wiring, navigation group, and policy hooks.

Pro tips

  • Set [key_columns] to the fields admins actually scan — these drive the list columns plus what's searchable and sortable, so a thoughtful list saves later edits.
  • Match [import_source] to reality; a CSV upload and an external API pull produce different upload and parsing code, and a vague value gives a generic importer.
  • Keep the dry-run in deliverable 3 — previewing changes before commit is what prevents an accidental bad mass-update from an import file.
  • Name [roles] precisely so Shield gates each action correctly; "admin and support-manager" yields tighter policies than a single broad role.
  • Run the registration steps exactly as returned, since a missing provider wire or navigation group is the most common reason a resource doesn't appear.
  • Ask a follow-up to add a feature test for the import path; verifying the dry-run and commit behaviour separately catches edge cases early.

Frequently Asked Questions

Does the bulk-import page preview changes before committing them?
Yes. Deliverable 3 builds a custom page for bulk import from your `[import_source]` with a dry-run preview before commit, so an admin can review what will change before any data is written. This is what protects against a bad mass-update.
Can I control which roles access the resource?
Yes, via the `[roles]` variable. The prompt wires RBAC through Filament Shield so only the roles you list can reach each action. Setting roles like admin and support-manager precisely produces tighter access policies than one broad role.
What does the [import_source] variable change in the output?
It determines the import UI and parsing logic on the custom page. A CSV upload generates file-upload and row-parsing code, while an API source generates fetch-and-map code instead. Matching it to your real source avoids reworking the importer later.
Does it include the steps to register the resource in Filament?
Yes. Deliverable 6 returns the registration steps covering provider wiring, navigation group, and policy hooks. Following these exactly matters because a missing wire or navigation group is a common reason a resource fails to appear in the panel.
Will the generated code work without changes?
It is designed to be copy-ready, but treat it as a strong scaffold. You should still adapt field types and validation to your model and add a feature test for the import path, since the AI cannot see your exact schema or business rules.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

More in Laravel & PHP Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

AI assistant · trained on my work

👋

Hey there!

Quick Actions

WhatsApp Direct line to me

Chat on WhatsApp

+880 1723 741224 · Replies within the hour on working days

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

mejba.13@gmail.com

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support