ronnytorresmtz/date-inline 问题修复 & 功能扩展

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

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

ronnytorresmtz/date-inline

Composer 安装命令:

composer require ronnytorresmtz/date-inline

包简介

A Laravel Nova field.

README 文档

README

This package allow you to edit a Date field in the index page with one click

Installation

    composer require ronnytorres/date-inline

Usage

Add the field to your resource without edition

public function fields(Request $request)
{
        return [

                DateInline::make('Start Date'),

        ];
        
}

To edit the Date field you need to click it on.

If you press the Esc key or lost the focues the field will became not editable.

Add the field to your resource and allow to edit with one click

public function fields(Request $request)
{
        return [

                DateInline::make('Start Date')
                        ->inlineOnIndex(),
                
        ];
        
}

The inlineOnIndex method also accepts a closure with the current request if you want to make it editable dynamically.

public function fields()
{
    return [
        InlineText::make('Start Date')
            ->inlineOnIndex(function (NovaRequest $request) {
                return $request->user()->isAdmin();
            }),
    ];
}

Show the message 'Date is overdue' at the bottom of the date field

public function fields(Request $request)
{
        return [

        DateInline::make('End Date')
                ->showOverdue(),
        ];
}

Show a toast message if one date is not greater than other one

public function fields(Request $request)
{
        return [

        DateInline::make('Start Date'),
        
        DateInline::make('End Date')
                ->greaterThan('Start Date),
        ];
}

The date field in your migrations/database must be nullable

$table->date('data_field_name')->nullable();

Resoure Example

Image

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: Vue

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固