8000 GitHub - swiftmade/nova-date-range: Date range picker field for Laravel Nova
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

swiftmade/nova-date-range

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
< 8000 div class="react-directory-filename-cell">
 
 

Repository files navigation

Laravel Nova Daterange picker

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 (MIT). Please see License File for more information.

About

Date range picker field for Laravel Nova

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 48.4%
  • Vue 46.2%
  • JavaScript 5.4%
0