定制 think.studio/nova-list-card 二次开发

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

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

think.studio/nova-list-card

最新稳定版本:4.3.1

Composer 安装命令:

composer require think.studio/nova-list-card

包简介

Laravel Nova card with resources list

README 文档

README

Packagist License Packagist Version Total Downloads Build Status Code Coverage Scrutinizer Code Quality

nova-list-card

Nova Package
V1-V3 V1-V3
V4 V4

Install

composer require think.studio/nova-list-card

Usage

nova-list-card

class FundsWithReportsCount extends ListCard
{
    public function __construct($component = null)
    {
        parent::__construct($component);

        $this->resource(\App\Nova\Resources\Fund::class)
            ->heading($this->name(), 'Reports')
            ->withCount('reports')
            ->orderBy('reports_count', 'desc')
            ->limit(100)
            ->value('reports_count');
    }

    public function cacheFor(): int|Carbon
    {
        return Carbon::now()->addMinutes(2);
    }
}

nova-list-card

class FundsWithReportIncomeSum extends ListCard
{
    public function __construct($component = null)
    {
        parent::__construct($component);

        $this->resource(\App\Nova\Resources\Fund::class)
            ->heading($this->name(), 'Total Income')
            ->withSum('reports', 'income')
            ->orderBy('reports_sum_income', 'desc')
            ->limit(100)
            ->value('reports_sum_income');
    }
}

nova-list-card

class FundsCustomList extends ListCard
{

    public function __construct($component = null)
    {
        parent::__construct($component);

        $this->resource(\App\Nova\Resources\Fund::class)
            ->heading($this->name())
            ->limit(100)
            ->timestamp('updated_at', 'm/Y')
            ->queryCallback(fn (Builder $q) => $q->where('publication_status', 'draft'));
    }

    public function name(): string
    {
        return 'Draft funds';
    }
}

nova-list-card

class FundsWithValueFormat extends ListCard
{
    public function __construct($component = null)
    {
        parent::__construct($component);

        $this->resource(\App\Nova\Resources\Fund::class)
            ->heading($this->name(), 'Created at')
            ->limit(100)
            ->timestamp('updated_at', 'm/Y')
            ->value('created_at', 'datetime', 'm/Y')
            ->classes('bg-yellow-300')
            ->noMaxHeight();
    }
}

Credits

  • Think Studio

统计信息

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

GitHub 信息

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

其他信息

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