Download the PHP package marshmallow/nova-tabs without Composer
On this page you can find all versions of the php package marshmallow/nova-tabs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package nova-tabs
- Requirements
- Installation
- Usage
- Tabs Panel
- Relationship Tabs
- Combine Fields and Relations in Tabs
- Actions in Tabs
- Tabs on Edit View
- Tab object
- Customization
- Tab
- Default search
- Display more than 5 items
- Upgrade to V2
Requirements
php: ^7.4 | ^8
laravel/nova: ^4
For Laravel Nova Version 3, please use nova-tabs v1 instead.
Installation
You can install the package in to a Laravel app that uses Nova via composer:
Usage
Tabs Panel
You can group fields of a resource into tabs, you can use an array or a Tab object (as of 1.4.0)::
or
The first tab in every Tabs
instance will be auto-selected.
Relationship Tabs
These are a bit outdated, as the search and create buttons now show within the panel down where the actual content is displayed, not in the tab panel.
Combine Fields and Relations in Tabs
Actions in Tabs
If your Model uses the Laravel\Nova\Actions\Actionable
Trait you can put the Actions into a Tab like this:
Tabs on Edit View
Tabs are always shown on edit view as of Nova 4 for now.
Tab object
As of v1.4.0 it's possible to use a Tab
class instead of an array to represent your tabs.
Property | Type | Default | Description |
---|---|---|---|
name | string |
null |
The name of the tab, used for the slug. Defaults to the title if not set |
showIf | bool or Closure |
null |
If the result is truthy the tab will be shown. showIf takes priority over showUnless and if neither are set, true is assumed. |
showUnless | bool or Closure |
null |
If the result is falsy the tab will be shown. showIf takes priority over showUnless and if neither are set, true is assumed. |
bodyClass | string or array |
Empty array | A string or string array of classes to add to the tab's body. This sets the bodyClass property, if you want to append you can use addBodyClass instead. |
Customization
Display more than 5 items
By default, any HasMany
, BelongsToMany
and MorphMany
fields show 5 items in their index. You can use Nova's built-in static property $perPageViaRelationship
on the respective resource to show more (or less).
Upgrade to 2.0.0
- Breaking changes
- Removed selectFirstTab, first tab is always displayed first.
- Even if you have other panels, tabs will always show up first and has the toolbar.
- TabsOnEdit is gone and non relational tabs will simply always display on edit.
- I don't use dusk, so didn't check the tests for it either, they might be broken.
- Added Eminiarts\Tabs\Traits\HasTabs to overwrite Nova 4 default panel methods in Laravel\Nova\ResolveFields.
- Moved Eminiarts\Tabs\ActionsInTabs to Eminiaarts\Tabs\Traits\HasActionsInTabs.
- Added position method to Tab to fix relational tabs showing up last.
Credits
Banner was created with https://banners.beyondco.de/