taylanunutmaz / nova-inline-morph-to
A Laravel Nova field for displaying morphTo relationship inline.
v0.3.0
2021-09-17 10:45 UTC
Requires
- php: >=7.1.0
- dev-master
- v0.3.0
- v0.2.1
- v0.2.0
- v0.1.10
- v0.1.9
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-dependabot/npm_and_yarn/path-parse-1.0.7
- dev-dependabot/npm_and_yarn/ws-6.2.2
- dev-dependabot/npm_and_yarn/dns-packet-1.3.4
- dev-dependabot/npm_and_yarn/browserslist-4.16.6
- dev-dependabot/npm_and_yarn/lodash-4.17.21
- dev-dependabot/npm_and_yarn/url-parse-1.5.1
- dev-dependabot/npm_and_yarn/ssri-6.0.2
- dev-dependabot/npm_and_yarn/y18n-4.0.1
- dev-dependabot/npm_and_yarn/elliptic-6.5.4
- dev-dependabot/npm_and_yarn/axios-0.21.1
- dev-dependabot/npm_and_yarn/ini-1.3.8
This package is auto-updated.
Last update: 2025-04-17 18:33:50 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.