sparclex/nova-creatable-belongs-to
sparclex/nova-creatable-belongs-to adds an inline Create New option to Laravel Nova BelongsTo relationship fields, letting users create related records directly from the parent form without leaving the page. It streamlines data entry and reduces navigation in Nova admin workflows.
composer require sparclex/nova-creatable-belongs-to. No service provider registration or config publish is required — it's a Nova field, not a package with runtime bootstrapping.fields() method inside a creation modal, so the modal experience is only as good as the resource definition you're pointing at. If Category has panels, file uploads, or relationship chains that don't make sense in a 400px modal, fix that resource before wiring the field.Post belongs to Category, and editors are tired of leaving the post form to create a missing category. In app/Nova/Post.php, swap BelongsTo::make('Category') for the package's field and keep everything else identical — it's a drop-in replacement.create ability). Log in as a non-admin and confirm the option disappears, because the most common first bug report is "the create button doesn't show" and the answer is almost always a policy, not the field.BelongsTo, every modifier you already use keeps working: searchable(), nullable(), rules(), withMeta(), relatableQueryUsing(), dependsOn(). Use it as a straight substitution rather than wrapping it in custom logic.create policies to control exposure rather than conditionally building the field list. If you need to restrict which resources can be created inline, do it in the policy or via relatableQueryUsing() on the parent query, not by branching resource fields() methods.searchable(). On any resource with more than a few dozen rows, the select is unusable without it, and Nova's search endpoint is what the field's lookup uses. Combined with relatableQueryUsing(), you get scoped search (e.g. only categories for the current tenant) plus inline creation in one control.rules() on the related resource's fields are what run. Duplicate this validation in the parent resource only if you also need it for the selected (not created) case.HasMany inline form or a dependent field chain, prefer a plain BelongsTo. Modals inside modals inside repeatable fields are where this field degrades.BelongsTo::showCreateRelationButton(), which covers the same ground for many teams. If you're on Nova 4, prototype with the built-in first; adopt this package only if you specifically need its UX. With 14 stars, you're taking on a small-supply-chain dependency — pin the version in composer.json and be ready to fork.create method on the related resource's policy returns true for the logged-in user. Debug in the browser network tab, not in Blade.BelongsTo fields pointing elsewhere, panels with computed metrics — all of it shows up. If your target resource is heavy, consider a dedicated lightweight Nova resource (or conditional fields() based on $request->isMethod('post') / context) purely for creation.dependsOn won't chain inside the modal. The modal has no access to the parent form's state, so any field in the related resource that depends on the parent form's values will render empty or uninitialized. Design the related resource so its creation form is self-contained.store controller with side effects (slugs, notifications, attaching tenants), those still run because it hits the standard endpoint — verify it, because people often assume modal creation skips them. The failure mode is a record created without the tenant/user scoping your controller normally applies.meta via withMeta() or subclass the field to adjust the modal's labels. There's no config file, so subclassing is the supported escape hatch for anything the README doesn't expose.How can I help you explore Laravel packages today?