think.studio/nova-html-field

HTML Laravel Nova field. (alternative of text field)
3,564
Install
composer require think.studio/nova-html-field
Latest Version:2.3.1
PHP:^8.1
License:MIT
Last Updated:Oct 5, 2023
Links: GitHub  ·  Packagist
Maintainer: think.studio

Laravel nova HTML Field

Packagist License Packagist Version Total Downloads Build Status Code Coverage Scrutinizer Code Quality

Nova Package
V1 V1
V4 V2

Usage Warning!

If you want use html only on Index (Preview) or Details screen, then please use default laravel nova functionality:

\Laravel\Nova\Fields\Text::make('Preview', function () {
    return view('custom-link', [
        'url' => url('/preview'),
        'id' => $this->id,
    ])->render();
})->asHtml();

The package was created to add such a feature also to the Update and Create screens. (By default, Create screen is disabled.)

Installation

You can install the package via composer:

composer require think.studio/nova-html-field

Usage

Html::make('Preview', function () {
    return view('nova-html-field::blocks.link', [
        'href' => url('/preview'),
        'linkText' => 'Preview',
        'target' => '_blank',
    ])->render();
})->clickable();

Html::make('Preview', function () {
    return view('nova-html-field::blocks.links', [
        'links' => [
            [
                'href' => url('/preview'),
                'title' => 'title',
                'target' => '_blank',
            ],
            [
                'href' => url('/preview'),
                'title' => 'title',
                'target' => '_blank',
            ],
        ]
    ])->render();
})
    ->clickable()
    ->showOnIndex()
    ->showOnPreview(),
Html::make('Docs', fn() => view('nova-html-field::blocks.link', [ 'href' => $this->resource->pdfUrl(), ])->render() )
    ->showOnCreating()
     ->clickable()
    ->help('Link to documentation');

Credits

  • Think Studio

Related Packages

reliese/laravel

Reliese Components for Laravel Framework code generation.

3,991,690 1,705
php-tmdb/laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the...

53,315 160
laravel-ja/laravel

The Laravel Framework.

5,667 17
kavenegar/laravel

laravel 4 and 5 kavenegar integration

368,693 86
laravel/laravel

The skeleton application for the Laravel framework.

64,930,508 84,972