joshmoreno / nova-html-field
A Laravel Nova field for rendering custom html on index, detail, and forms.
Installs: 82 127
Dependents: 2
Suggesters: 0
Security: 0
Stars: 14
Watchers: 2
Forks: 3
Open Issues: 18
Requires
- php: >=7.1.0
- dev-master
- v0.1.0
- dev-dependabot/npm_and_yarn/express-4.18.2
- dev-dependabot/npm_and_yarn/qs-6.5.3
- dev-dependabot/npm_and_yarn/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/loader-utils-1.4.2
- dev-dependabot/npm_and_yarn/async-2.6.4
- dev-dependabot/npm_and_yarn/minimist-1.2.6
- dev-dependabot/npm_and_yarn/url-parse-1.5.10
- dev-dependabot/npm_and_yarn/path-parse-1.0.7
- dev-dependabot/npm_and_yarn/dns-packet-1.3.4
- dev-dependabot/npm_and_yarn/hosted-git-info-2.8.9
- dev-dependabot/npm_and_yarn/lodash-4.17.21
- dev-dependabot/npm_and_yarn/y18n-3.2.2
- dev-dependabot/npm_and_yarn/elliptic-6.5.4
- dev-dependabot/npm_and_yarn/ini-1.3.8
- dev-dependabot/npm_and_yarn/http-proxy-1.18.1
- dev-dependabot/npm_and_yarn/websocket-extensions-0.1.4
This package is auto-updated.
Last update: 2024-11-12 10:34:18 UTC
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>