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.
Install via Composer:
composer require inani/nova-resource-maker
Register the tool in app/Providers/NovaServiceProvider.php inside the tools() method:
use Inani\NovaResourceMaker\NovaResourceMaker;
public function tools()
{
return [
new NovaResourceMaker(),
];
}
Open Nova in your browser — a new sidebar item ("Resource Maker" or similar) will appear. That's your first stop.
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.
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.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.local/staging environments:
public function tools()
{
return $this->app->environment(['local', 'staging'])
? [new NovaResourceMaker()]
: [];
}
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.laravel/nova isn't already present and autoloaded.tools() (not resources()) and ran php artisan nova:publish is not required but composer dump-autoload may be after installation.Resource class, fields() helper methods, or field macros. Paste and adapt; don't paste blindly into a resource that overrides fields() from a parent.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.Number::make('status') for what is really a status enum; expect Number::make('author_id') rather than BelongsTo. Always review these two categories.$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()).nova:resource + manual field authoring.Text::make('title') is not hard to type.How can I help you explore Laravel packages today?