PHP code example of yaroslawww / nova-html-field

1. Go to this page and download the library: Download yaroslawww/nova-html-field library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yaroslawww / nova-html-field example snippets


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

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');