Laravel Community Tools by Tighten
Laravel Nova icon Nova Packages
N

Tooltip Field

Readme

Laravel Nova 4 Tooltip field

A Laravel Nova Tooltip field for the index view.

When you want to show additional data but do not want to clutter the table, put it in a tooltip.

Inspired by: https://github.com/philperusse/nova-tooltip-field

Demo

Demo #1

Installation

Run this command in your Laravel Nova project:

$ composer require helios-live/nova-tooltip-field

Usage

Use this field as any other fields. By design, this field will only be shown on index (lists) views.

use Ideatocode\NovaTooltipField\Tooltip;

 Tooltip::make('More', function(){
    return 'This a tooltip. You can put lengthy content here or any additional info.';
 }),

HTML

You can also pass HTML to the tooltip.

Tooltip::make('More', function(){
	return '<h4>Additional User info</h4>'
		. ' <strong>Created at : </strong>' . Carbon::parse($this->created_at)->diffForHumans()
		. '<br>'
		.' <strong>Updated at : </strong>' . Carbon::parse($this->created_at)->diffForHumans();
})->asHtml(),

Demo #2

Trigger element

You can also pass change the trigger element of the tooltip.

Tooltip::make('More', function(){
	return '<h4>Additional User info</h4>'
		. ' <strong>Created at : </strong>' . Carbon::parse($this->created_at)->diffForHumans()
		. '<br>'
		.' <strong>Updated at : </strong>' . Carbon::parse($this->created_at)->diffForHumans();
})->asHtml()->trigger('oh <b>Ya!</b>'),

Contributions

All contributions are welcomed. Please send a PR.

Authors

The styles are based on Bootstrap's Tooltip component.

License

This package is open-sourced software licensed under the MIT Licence

Back to Top
Added 3 years ago
Last updated 8 Months Ago
Version v1.0.2
Nova Version ^4.0|^5.0
Composer
ideatocode/nova-tooltip-field
GitHub stars 2
Packagist downloads 24,801

Favorites

0 users favorited

Rating

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

Contributors

Brought to you by Tighten

Issues/Feature Requests Stats Package Ideas