Laravel Community Tools by Tighten
Laravel Nova icon Nova Packages

Readme

A nova field for rendering html on all resource pages: index, detail, and forms. This is hopefully a temporary solution until nova supports computed fields on forms.

Install

composer require joshmoreno/nova-html-field

Usage

Inline string

\JoshMoreno\Html\Html::make('Some Title')
    ->html('<h1>Example</h1>'),

Closure

\JoshMoreno\Html\Html::make('Some Title')
    ->html(function() {
        return "<h1>$this->name</h1>";
    }),

View

\JoshMoreno\Html\Html::make('Some Title')
    ->view('fields.example'),
<div class="px-8 py-6 border-b border-40">
    <h1 class="mb-2">Custom Html</h1>
    <p>This is all custom html!</p>
</div>

View with access to model attributes

\JoshMoreno\Html\Html::make('Some Title')
    ->html(function() {
        return view('fields.example')
                 ->with('name', $this->name)
                 ->render();
    }),
<div class="px-8 py-6 border-b border-40">
    <h1 class="mb-2">Hi {{$name}}</h1>
    <p>This is all custom html with data!</p>
</div>

Screenshots

Reviews

By efolam on December 3, 2021

Nice package!!!

Back to Top
Added 5 years ago
Last updated 5 Years Ago
Version v0.1.0
Composer
joshmoreno/nova-html-field
GitHub stars 13
Packagist downloads 96,940

Favorites

8 users favorited

Rating

5.00
(out of 5)
★★★★★
★★★★
★★★
★★
1 ratings

Author

Brought to you by Tighten

Issues/Feature Requests Stats Package Ideas