# `mix phx_filament.gen.resource`
[🔗](https://github.com/franciscpd/phoenix-filament/blob/main/lib/mix/tasks/phx_filament.gen.resource.ex#L1)

Generates a PhoenixFilament resource for an Ecto schema.

## Usage

    mix phx_filament.gen.resource MyApp.Blog.Post
    mix phx_filament.gen.resource MyApp.Blog.Post --repo MyApp.Repo.ReadOnly

## What it does

1. Creates a Resource module at `lib/{app_web}/admin/{name}_resource.ex`
2. Attempts to register the resource in your Panel module automatically
3. Falls back to printing instructions if the Panel module cannot be found or patched

## Options

- `--repo` / `-r` — Ecto Repo module to use. Auto-detected from `use Ecto.Repo` modules,
  defaults to `{AppName}.Repo` if none found.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
