Custom date range picker field for Laravel Nova
kpolicar/nova-date-range is a Laravel package for custom date range picker field for laravel nova.
It currently has 26 GitHub stars and 181.486 downloads on Packagist.
Install it with composer require kpolicar/nova-date-range.
Discover more Laravel packages by kpolicar
or browse all Laravel packages to compare alternatives.
Last updated
This package adds a new custom daterange picker field to Laravel Nova.
![]()
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'
];
}
You can install this package in to a Laravel app that uses Nova via composer:
composer require kpolicar/nova-date-range
The MIT License. Please see License File for more information.