gabrielesbaiz/nova-card-html
最新稳定版本:2.2.0
Composer 安装命令:
composer require gabrielesbaiz/nova-card-html
包简介
A Laravel Nova card that displays any html content.
README 文档
README
A Laravel Nova card that displays any html content.
Original code from abordage/nova-card-html
Features
- ✅ HTML content in Nova card
- ✅ Variable height
Installation
You can install the package via composer:
composer require gabrielesbaiz/nova-card-html
Usage
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.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 923
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-03-05