taylanunutmaz / nova-inline-morph-to
A Laravel Nova field for displaying morphTo relationship inline.
Package info
github.com/taylanunutmaz/nova-inline-morph-to
pkg:composer/taylanunutmaz/nova-inline-morph-to
v0.3.0
2021-09-17 10:45 UTC
Requires
- php: >=7.1.0
This package is auto-updated.
Last update: 2026-06-17 21:00:37 UTC
README
Install
composer require taylanunutmaz/nova-inline-morph-to
Usage
The signature is the same as the default MorphTo field that ships with Nova.
use DigitalCreative\InlineMorphTo\InlineMorphTo; use DigitalCreative\InlineMorphTo\HasInlineMorphToFields; class Article extends Resource { use HasInlineMorphToFields; public function fields(Request $request) { return [ ... InlineMorphTo::make('Template') ->types([ \App\Nova\Video::class, \App\Nova\Image::class, \App\Nova\Text::class, \App\Nova\Gallery::class, ]) ->default(\App\Nova\Text::class), ... ]; } }
Note: You will need to import the HasInlineMorphToFields trait for this field to display correctly within resource detail views.
Code example: adding morphables dynamically from a directory #4
License
The MIT License (MIT). Please see License File for more information.
