PHP code example of inspheric / nova-url-field

1. Go to this page and download the library: Download inspheric/nova-url-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/ */

    

inspheric / nova-url-field example snippets


use Inspheric\Fields\Url;

Url::make('Homepage')
    ->rules('url', /* ... */),

Url::make('Homepage')
    ->label('External Link'),

Url::make('Homepage')
    ->labelUsing(function($value, $resource) {
        return $this->title;
    }),

Url::make('Homepage')
    ->label('<strong>External</strong> Link')
    ->asHtml(),

Url::make('Homepage')
    ->domainLabel(),

Url::make('Homepage')
    ->nameLabel(),

Url::make('Homepage')
    ->title('Link title'),

Url::make('Homepage')
    ->titleUsing(function($value, $resource) {
        return $this->title;
    }),

Url::make('Homepage')
    ->clickable(bool $clickable = true),

Url::make('Homepage')
    ->clickableOnIndex(bool $clickable = true),

Url::make('Homepage')
    ->alwaysClickable(bool $clickable = true),

Url::make('Homepage')
    ->sameTab(bool $sameTab = true),

Url::make('Homepage')
    ->noopener(bool $noopener = true),

Url::make('Homepage')
    ->noreferrer(bool $noreferrer = true),

Url::make('Homepage')
    ->customHtml('<span class="my-class">Click here!</span>'),

Url::make('Homepage')
    ->customHtmlUsing(function($value, $resource, $label) {
        return view('partials.link_text', [
            'url'   => $value,
            'label' => $label,
        ])->render();
    }),