Skip to content

A Laravel Nova field for displaying morphTo relationship inline.

License

Notifications You must be signed in to change notification settings

dcasia/nova-inline-morph-to

Repository files navigation

Nova Inline MorphTo Field

Latest Version on Packagist Total Downloads License

Laravel Nova Inline MorphTo Field in action

Install

composer require digital-creative/nova-inline-morph-to

Usage

The signature is the same as the default MorphTo field that ships with Nova.

use DigitalCreative\InlineMorphTo\InlineMorphTo;

class Article extends Resource
{
    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,
            ]),
            ...
        ];

    }
}

License

The MIT License (MIT). Please see License File for more information.