定制 hapheus/nova-single-value-card 二次开发

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

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

hapheus/nova-single-value-card

Composer 安装命令:

composer require hapheus/nova-single-value-card

包简介

A Laravel Nova card that displays a single value.

README 文档

README

A Laravel Nova card that displays a single value.

Nova Single Value Cards

I really like to use Trend Metric Card from Laravel Nova to get a quick overview. But sometimes I want to have values in the cards that can't be represented by the standard trends. Of course there are already some card packages that show e.g. the total records in a card. The reason why I made this small package anyway is because I want to show all values and don't want to have a separate package for each case. If I want to display the total records I can simply pass Model::count() and that's it. And then everything is kept in the same style and does not mix.

And yes, I'm considering doing the same thing for the trends and just passing the class in the constructor.

Requirements

  • PHP 7.4 or higher
  • Nova 4

Installation

composer require hapheus/nova-single-value-card

Usage

namespace App\Nova\Dashboards;

use App\Nova\Metrics\LocationsPerDay;
use Hapheus\NovaSingleValueCard\NovaSingleValueCard;
use Illuminate\Support\Facades\App;
use Laravel\Nova\Dashboards\Main as Dashboard;

class Main extends Dashboard
{
    public function cards()
    {
        return [
            new NovaSingleValueCard('Environment', config('app.env')),
            new NovaSingleValueCard('Queue Size (default)', App::make('queue.connection')->size('default')),
            new LocationsPerDay,
        ];
    }
}

WIP

  • Implementation of simple colors for the text and the background

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固