tomatophp/tomato-resource
Tomato Resource generates complete CRUD resources for your TomatoPHP admin panel, turning Eloquent models into ready-to-use forms, tables, and pages with sensible defaults and configurable builders.
tomato-resource is the resource-definition layer of the TomatoPHP admin stack: one class per Eloquent model declares columns, form fields, filters, relationships, and actions, and a generator emits the migration, model, and CRUD wiring from that definition. The decision it informs is whether to standardize internal admin screens on Tomato Admin versus hand-rolling Laravel controllers/policies or buying into a mainstream admin framework (Filament, Nova, Backpack). It is only a real option if Tomato Admin is already (or is about to be) the panel of record.Consider it when:
tomato-admin, tomato-crud, and tomato-forms it yields a config file and a base class, and generated resources are consumed by those packages rather than rendering screens themselves.Look elsewhere when:
Adoption gates to clear before committing: verified compatibility with your Laravel/PHP/database versions (read composer.json — there is no documented support matrix); reviewed service providers, published migrations, and any tests; confirmation that generation into a populated app/ is non-destructive and that outputs are versioned; a documented exit path (your own base resource class as an interface boundary) so switching cost stays low; and a pinned constraint (1.0.*) rather than an open one. Treat generated migrations as a review artifact — unsupported field types tend to be dropped silently rather than raising an error, so a manual diff against the intended schema after every generation is a required control, not a debugging step.
For executives: tomato-resource is a component of the TomatoPHP admin ecosystem that turns a declarative resource definition into a working back-office CRUD screen — migration, model, table, form, filters, and routes. The business case is reduced hand-built admin work and a consistent internal pattern, not new customer-facing capability: fewer engineer-hours per internal screen and less divergence between admin pages. The honest caveat is adoption risk — one star, zero dependents, a single 1.0 release in October 2023 and nothing since — so the recommendation is a scoped, time-boxed pilot behind one internal tool with a named fallback, not a platform-wide commitment. Risk is containable because we pin the version, review and commit generated code, and validate on one real resource before expanding. It only makes sense if we are already invested in Tomato Admin; if we are not, the comparison is Filament/Nova or plain Laravel and we should evaluate those instead.
For engineering: the package provides a fluent, class-based resource definition plus a generator pipeline (field schema → migration, model, CRUD wiring) with builders for forms, tables, filters, relationships, and actions, translation files, and a published config controlling field types and generation paths. Integration is Composer plus publishable config, migrations, and lang files — then optimize:clear. It depends on tomato-admin, tomato-crud, and tomato-forms; if the panel doesn't render, the fault is almost always upstream in those, not here. Non-obvious operational rules: the generator owns artifact files, so commit its output and never run it in CI; keep custom logic in a subclassed base resource or trait because regeneration overwrites inline edits; watch for model/controller name collisions derived from table names before generating into a populated app/; and clear cache first when a new field doesn't appear in the UI. Authorization and server-side validation assumptions are undocumented — wire policies and validation explicitly at the controller layer rather than trusting generated types. Load-test index pages for eager-loading gaps before any high-traffic admin area depends on them. Treat the base resource class and the published config as the only two sanctioned extension points, and wrap the vendor base class behind our own so a future swap stays cheap.
How can I help you explore Laravel packages today?