Download the PHP package pos-lifestyle/laravel-nova-date-range-filter without Composer
On this page you can find all versions of the php package pos-lifestyle/laravel-nova-date-range-filter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-nova-date-range-filter
Laravel Nova Date Range Filter
About
This is a configurable and ready to use filter for Laravel Nova 2 based on Nova's own date filter that displays a date range picker.
Installation
To install the filter run the following command in your Laravel Nova project:
Usage
Simply add this filter to the filters
method in your Nova resource.
By default, this will create a filter named "Created at" which applies the selected date range to the created_at
database column.
Customization
The filter takes up to three arguments to customize it to your needs.
Parameter | Type | Description | Default |
Name | String | The name of the filter how it should appear in the filter dropdown list. | "Created at" |
Column | String | The name of the database column on which the selected date range should be applied to. | Illuminate\Database\Eloquent\Model::CREATED_AT |
Settings | Array | An array of settings to customize the filter. See the configuration section below for details. | [] |
Configuration
All available settings are provided by the included Config
enum. See the full example below how to use it.
Setting | Type | Description | Default |
ALLOW_INPUT | Boolean | Allows the user to enter a date directly into the input field. | false |
DATE_FORMAT | String | A string of characters which are used to define how the date will be displayed in the input box. The supported characters are defined in this table. | "Y-m-d" |
DEFAULT_DATE | Array |
Sets the initial selected dates. Supply an array of date strings which follow the format Y-m-d .
|
null |
DISABLED | Boolean | Entirely disables the filter. | false |
ENABLE_TIME | Boolean | Enables the time picker. | false |
ENABLE_SECONDS | Boolean | Enables seconds in the time picker. | false |
FIRST_DAY_OF_WEEK | Integer | Sets the first day of the week (0 = Sunday, 1 = Monday etc.). If a custom locale is used, this setting has no effect. | 0 |
LOCALE | String | Localizes the filter. Available locales can be found here. | "default" |
MAX_DATE | String | The maximum date that a user can pick to (inclusive). | null |
MIN_DATE | String | The minimum date that a user can start picking from (inclusive). | null |
PLACEHOLDER | String | The text that is shown in the empty input box. | __('Choose date range') |
SHORTHAND_CURRENT_MONTH | Boolean | Shows the month using the shorthand version (e.g. Sep instead of September). | false |
SHOW_MONTHS | Integer | The number of months that should be showed. | 1 |
TIME24HR | Boolean | Displays the time picker in 24 hour mode without AM/PM selection when enabled. | false |
WEEK_NUMBERS | Boolean | Enables the display of week numbers in the calendar. | false |
Full Example
Screenshots
Default configuration | Showing 2 months |
All versions of laravel-nova-date-range-filter with dependencies
laravel/framework Version ^5.8 || ^6.0 || ^7.0 || ^8.0
laravel/nova Version ^2.0 || ^3.0