Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Nova Resource Maker Laravel Package

inani/nova-resource-maker

A Laravel Nova package for quickly generating and scaffolding Nova resources, helping you turn models into admin panels with less boilerplate. Useful for speeding up CRUD setup and standardizing resource files in Nova applications.

View on GitHub
Deep Wiki
Context7

Getting Started

  1. Install via Composer:

    composer require inani/nova-resource-maker
    
  2. Register the tool in app/Providers/NovaServiceProvider.php inside the tools() method:

    use Inani\NovaResourceMaker\NovaResourceMaker;
    
    public function tools()
    {
        return [
            new NovaResourceMaker(),
        ];
    }
    
  3. Open Nova in your browser — a new sidebar item ("Resource Maker" or similar) will appear. That's your first stop.

  4. First use case: pick an existing Eloquent model (e.g. App\Models\Post), let the tool introspect the table, and copy the generated fields() array into the matching app/Nova/Post.php resource as a starting scaffold. This is the fastest win — it saves you hand-writing Text::make('title'), DateTime::make('published_at'), etc. for every column.

Where to look first if it misbehaves: the tool's routes/ and src/ directories after installation — it's a small package, so reading the source is faster than guessing. Check composer.json for the laravel/nova version constraint before installing on a modern Nova app.

Implementation Patterns

  • Scaffold-then-refine: Generate the fields() array for a new resource, paste it into your Nova resource, then manually adjust labels, visibility (hideFromIndex, onlyOnDetail), and validation. The tool gives you a solid ~80% starting point; the remaining 20% is domain knowledge it can't infer.
  • Bulk resource bootstrapping: When migrating a legacy app with many tables, run through each model one-by-one in the tool, keep the generated arrays in a scratch file, then create the Nova resources. Effectively turns a repetitive multi-hour task into a multi-minute one per resource.
  • Field-type mapping: The tool maps database column types (string → Text, text → Textarea, datetime → DateTime, integer → Number, boolean → Boolean) — treat its output as a first draft, especially for enums, JSON columns, and anything with a foreign key.
  • Integrate with your existing workflow: keep the tool registered only in local/staging environments:
     public function tools()
     {
         return $this->app->environment(['local', 'staging'])
             ? [new NovaResourceMaker()]
             : [];
     }
    
  • Relationship scaffolds: for belongs-to columns (author_id), expect the generator to produce a plain Number or ID field — swap it for BelongsTo::make('Author', 'author', User::class) yourself. The tool has no reliable way to infer your relationship naming.
  • Custom fields/partials: if your generated output contains a Nova field class you haven't installed, don't strip it — note the missing dependency, adjust, or add the package. This doubles as a quick "what fields does this model need" audit.

Gotchas and Tips

  • Age is the biggest risk: last release was Feb 2019 against Nova 1.x/2.x. Nova has moved substantially since. Expect registration failures on Nova 3+ and PHP 8. Pin and test in a throwaway branch before adding to a real project.
  • Nova must be installed as a dependency: this is a Nova tool, not a standalone package. It will error out or silently fail to register if laravel/nova isn't already present and autoloaded.
  • Tool discovery vs. manual registration: if the sidebar item doesn't appear, confirm you registered it in tools() (not resources()) and ran php artisan nova:publish is not required but composer dump-autoload may be after installation.
  • Generated code is plain PHP strings — it will not respect your app's custom base Resource class, fields() helper methods, or field macros. Paste and adapt; don't paste blindly into a resource that overrides fields() from a parent.
  • Hidden columns: database columns like deleted_at, created_at, updated_at, and pivot/junction tables will usually show up. Delete them manually or wrap in Timestamp::make(...)->hideFromIndex() — the generator does not know your intent.
  • Foreign keys and enums are weak spots: expect Number::make('status') for what is really a status enum; expect Number::make('author_id') rather than BelongsTo. Always review these two categories.
  • Debugging generated output: if the field array is empty or throws, check the tool reads your model's $table correctly — models with a dynamic table name (set in __construct or via $table mutations) can confuse the introspector. Compare against Schema::getColumnListing((new Post)->getTable()).
  • Extension points are minimal: with only ~24 stars and no dependents, don't expect hooks, config files, or a documented service provider binding to customise mapping. Fork it (it's small) or, for anything beyond a first-pass scaffold, prefer writing Nova resources by hand or using Nova's own nova:resource + manual field authoring.
  • Verdict for day-to-day use: worth it as a one-shot accelerator on a legacy-project migration where you already know Nova 1/2 is in play. Not worth introducing into a greenfield Nova 3/4 app — the compatibility risk outweighs the time saved, and Text::make('title') is not hard to type.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle