A Laravel Nova card that displays any html content.
gabrielesbaiz/nova-card-html is a Laravel package for a laravel nova card that displays any html content..
It currently has 0 GitHub stars and 12.681 downloads on Packagist (latest version 2.2.0).
Install it with composer require gabrielesbaiz/nova-card-html.
Discover more Laravel packages by gabrielesbaiz
or browse all Laravel packages to compare alternatives.
Last updated
A Laravel Nova card that displays any html content.
Original code from abordage/nova-card-html
You can install the package via composer:
composer require gabrielesbaiz/nova-card-html
To create a cards use the artisan command:
php artisan nova-card-html MyHtmlCard
$NovaCardHtml = new Gabrielesbaiz\NovaCardHtml();
echo $NovaCardHtml->echoPhrase('Hello, Gabrielesbaiz!');
By default, all new cards will be placed in the app/Nova/Cards directory. Once your html card class has been generated,
you're ready to customize it.
<?php
namespace App\Nova\Cards;
use Gabrielesbaiz\NovaCardHtml\NovaCardHtml;
class MyHtmlCard extends NovaCardHtml
{
/**
* Name of the card (optional)
*/
public string $title = '';
/**
* The width of the card (1/2, 1/3, 1/4 or full).
*/
public $width = '1/3';
/**
* The height strategy of the card (fixed or dynamic).
*/
public $height = 'fixed';
/**
* Align content to the center of the card.
*/
public bool $center = true;
/**
* Html content
*/
public function content(): string
{
return '<h1 class="text-4xl">Some content</h1>';
}
}
If set $height = 'fixed' content will scroll.
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.