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 Relationship Selector Laravel Package

eminiarts/nova-relationship-selector

A Laravel Nova field that adds a searchable relationship selector to forms. It lets users pick related Eloquent models from a dropdown, making belongsTo and belongsToMany inputs easier without manually entering IDs or keys.

View on GitHub
Deep Wiki
Context7

Getting Started

This package targets Laravel Nova and provides a fluent way to place a field inside a tabbed layout, integrating with eminiarts/nova-tabs.

  1. Require both packages: composer require <this-package> eminiarts/nova-tabs.
  2. Register the Nova tabs package per its README (publish/register the tab group resolver).
  3. In your Nova resource, define the field and chain ->inTabs():
use Eminiarts\Tabs\Tabs;

public function fields(Request $request)
{
    return [
        Tabs::make('Details', [
            ID::make()->sortable(),
            Text::make('Name')->inTabs('Main'),
        ]),
    ];
}

First thing to check after install: run a resource with a single tab and confirm the field renders inside it (not duplicated in the default/untabbed area). That single render is the fastest proof the wiring and the inTabs() helper agree.

Implementation Patterns

  • Tab-scoped fields: Chain ->inTabs('Tab Label') on any fields that should land in a specific tab instead of the default group. Keep the tab label consistent with the Tab::make(...) / Tabs::make(...) key used in the same resource.
  • Mixed tabbed/untabbed layouts: Fields without ->inTabs() remain in the default panel — useful for identity fields (ID, timestamps) that should stay outside the tabbed area.
  • Fluent composition: The call returns the field, so it composes cleanly with the rest of the Nova field chain (->rules(...), ->sortable(), ->hideFromIndex(), etc.). Apply inTabs() last for readability.
  • Reusable field factories: If you build fields in helper methods (e.g. $this->statusField()), pass the tab name in as an argument so the same field can be reused across resources with different tab layouts.
  • Testing: In Nova field unit tests, assert on the resolved meta rather than on rendered HTML — the tab assignment surfaces as meta on the field, which is cheap to check.

Gotchas and Tips

  • Label mismatch is silent: If the inTabs() string doesn't exactly match a tab key/label, the field can end up in the default area with no error. Verify labels character-for-character.
  • Ordering: Tab membership and field ordering interact; Nova's field ordering is driven by the array order in fields(), so group fields by tab in the array for predictable rendering.
  • Index/detail parity: inTabs() only affects form/detail layout. Index columns are unaffected — don't expect the tabs to change the index table.
  • Nova version sensitivity: nova-tabs pins to specific Nova majors. Confirm the compatibility matrix of both packages before upgrading Nova.
  • Debugging a missing field: Temporarily remove ->inTabs() — if the field reappears, the tab label is wrong or the tabs group isn't resolving. If it's missing in both cases, the issue is upstream in the tabs package.
  • Extension point: The fluent return means you can wrap it in your own field macro (Field::macro('inDetailsTab', fn() => $this->inTabs('Details'))) to centralise tab names and avoid string drift across resources.
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.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route