定制 pdmfc/nova-info-card 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pdmfc/nova-info-card

最新稳定版本:v1.0.1

Composer 安装命令:

composer require pdmfc/nova-info-card

包简介

A Laravel Nova info card.

README 文档

README

hero image

Total Downloads Latest Stable Version License

This package provides an easy-and-simple way to add notification cards to a Laravel Nova Resource.

Installation

composer require pdmfc/nova-info-card

Usage

use Pdmfc\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'

Example

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')

Heading screenshot

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 like this package and give us your feedback in
    <a href="https://github.com/pdmfc/nova-info-card/" class="underline font-bold text-blue-800">our repository</a>!')
    ->asHtml(),

Rendering raw Html

How to contribute

  • clone the repo
  • on composer.json of a laravel nova application add the following:
{
    //...

    "require" {
        "pdmfc/nova-info-card: "*"
    },

    //...
    "repositories": [
        {
            "type": "path",
            "url": "../path_to_your_package_folder"
        }
    ],
}
  • run composer update pdmfc/nova-info-card

You're now ready to start contributing!

统计信息

  • 总下载量: 100.97k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 15
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 14
  • Watchers: 3
  • Forks: 7
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-03-24