crusherrl/nova-info-card
Composer 安装命令:
composer require crusherrl/nova-info-card
包简介
A Laravel Nova info card.
README 文档
README
This Project is a fork which is compatible with Nova 4. Also, this package provides an easy-and-simple way to add notification cards to a Laravel Nova Resource.
Installation
composer require crusherrl/nova-info-card
Usage
use CrusherRL\NovaCards\Info; //... public function cards() { return [ (new Info()) ->info('Some info message') ]; }
Themes
This package comes with 4 predefined styles - info, success, warning and danger. To select a theme, just use the it as the method name.
If you need to generate a card theme dynamically, you can use the message() method which accepts two arguments - $message and $level.
->info($message) ->success($message) ->warning($message) ->danger($message) ->message($message, $level) // accepted values for $level: 'info', 'success' , 'warning', 'danger'
Defining a header
You can also define a heading for the message using the heading() method:
(new Info()) ->heading('Info heading') ->info('Some info message')
Render Html
If you want to render your message as raw html the same way that Nova lets you in resource fields, just chain the asHtml() method:
(new Info()) ->info('Be sure to checkout the original Project <a href="https://github.com/pdmfc/nova-info-card/" class="underline font-bold text-blue-800">pdmfc/nova-info-card</a>!') ->asHtml(),
Customizing with colors
Currently, the newest feature is to colorize specific or all parts of the card html.
Example to colorize the whole component:
(new Info()) ->info('Be sure to checkout the original Project <a href="https://github.com/pdmfc/nova-info-card/" class="underline font-bold text-blue-800">pdmfc/nova-info-card</a>!') ->setColors([ 'border' => 'rgb(48 107 203)', 'background' => 'hsl(217.09deg 88.71% 75.69%)', 'text' => '#4f4f4f', 'icon' => 'black' ]) ->asHtml(),
Also, you can set only specific parts, like only icon or only border.
(new Info()) ->info('Be sure to checkout the original Project<a href="https://github.com/pdmfc/nova-info-card/" class="underline font-bold text-blue-800">pdmfc/nova-info-card</a>!') ->setBorderColor('rgb(48 107 203)') ->setBackgroundColor('blue-200') ->setTextColor('#4f4f4f') ->setIconColor('black') ->asHtml(),
As you may have seen, there is a color called 'blue-200'. That's because is a predefined color which you can see here:
{
"blue-200": "rgb(191 219 254)",
"green-200": "rgb(187 247 208)",
"yellow-200": "rgb(254 240 138)",
"red-200": "rgb(254 202 202)",
"blue-600": "rgb(37 99 235)",
"green-600": "rgb(22 163 74)",
"yellow-600": "rgb(202 138 4)",
"red-600": "rgb(220 38 38)"
}
How to contribute
- clone the repo
- on
composer.jsonof a laravel nova application add the following:
{
//...
"require" {
"crusherrl/nova-info-card: "*"
},
//...
"repositories": [
{
"type": "path",
"url": "../path_to_your_package_folder"
}
],
}
- run
composer update crusherrl/nova-info-card
You're now ready to start contributing!
crusherrl/nova-info-card 适用场景与选型建议
crusherrl/nova-info-card 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.57k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 08 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「package」 「nova」 「laravel」 「card」 「info」 「nova4」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 crusherrl/nova-info-card 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 crusherrl/nova-info-card 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 crusherrl/nova-info-card 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova card that shows you your system information.
A Laravel Nova card.
A Laravel Nova package for publishable fields
A Laravel Nova package for translatable fields
A Laravel Nova Image field. you can paste or drag or chose an image
统计信息
- 总下载量: 9.57k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-29



