kpolicar/nova-date-range 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

kpolicar/nova-date-range

Composer 安装命令:

composer require kpolicar/nova-date-range

包简介

Custom date range picker field for Laravel Nova

README 文档

README

Description

This package adds a new custom daterange picker field to Laravel Nova.

Example

2018-10-01 11_28_00

Usage

To add a new daterange field, simply add it to your array of fields, providing the "from-to" attributes as parameters.

namespace App\Nova;

// ...

use Kpolicar\DateRange\DateRange;

class Reservation extends Resource
{
    // ...
    
    public function fields(Request $request)
    {
        return [
            // ...
            
            DateRange::make(['From', 'To']),
            // or DateRange::make('Between', ['from', 'to']),
            
            // ...
        ];
    }
}

You should also ensure the Eloquent model that your resource represents is casting the used attributes as dates.

namespace App\Nova;

// ...

class Reservation extends Model
{
    protected $dates = [
        'from', 'to'
    ];
}

Installation

You can install this package in to a Laravel app that uses Nova via composer:

composer require kpolicar/nova-date-range

License

The MIT License. Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-30