Download the PHP package javii-script/default-value-filterable without Composer
On this page you can find all versions of the php package javii-script/default-value-filterable. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download javii-script/default-value-filterable
More information about javii-script/default-value-filterable
Files in javii-script/default-value-filterable
Package default-value-filterable
Short Description A Nova macro that streamlines setting a default value in addition to enabling filtering functionality on a field.
License MIT
Informations about the package default-value-filterable
Nova Field Default Filter Macro
Nova Field Default Filter Macro is a custom macro for Laravel Nova that simplifies the process of setting default values and enabling filtering capabilities for fields.
Features
- Default Value for Filters: Easily set default values for fields when filters are applied.
- Customizable Filtering Logic: Define how the filtering is applied with custom callback functions.
- Seamless Integration: Designed specifically for Laravel Nova resources.
Screenshot
Requirements
To use this package, ensure your environment meets the following requirements:
- PHP:
^8.1
- Laravel Nova:
^5.0
Installation
Install the package via Composer:
Usage
The defaultFilterable macro makes it easy to define a default value for filters, enhancing the functionality of your Nova resources.
Basic Example
In this example, the Name field will have a default filter value of John Doe.
Advanced Example with Custom Filtering Logic
In this example:
- Default Value: The Name field will default to John Doe when filtering.
- Custom Filtering: The filtering logic will apply a LIKE clause to match records where the Name starts with the filter value.
Contributing
Contributions are welcome! If you have ideas for improvements or find any issues, feel free to open an issue or submit a pull request.
License
This package is open-sourced software licensed under the MIT license.