Find models within your Laravel system with minimal overhead
anthonyedmonds/laravel-find is a Laravel package for find models within your laravel system with minimal overhead.
It currently has 1 GitHub stars and 4.779 downloads on Packagist (latest version 6.4.1).
Install it with composer require anthonyedmonds/laravel-find.
Discover more Laravel packages by anthonyedmonds
or browse all Laravel packages to compare alternatives.
Last updated
Find and filter models with persistent memory of the user's last used parameters.
Add this library using composer require anthonyedmonds/laravel-find.
The service provider will be automatically registered.
Publish the config file using php artisan vendor:publish --tag=laravel-find-config"
To customise the search bar component, export it using php artisan vendor:publish --tag=laravel-find-views
LaravelFind provides a Finder base class which you can extend.
Fill out all of the abstract methods to provide users with a list of access filters, status filters, and sort options.
The search results and filters can then be provided to the user via the FinderOutput class on your blade.
The provided search bar template gives you an idea of how to present the various filters on the UI.
Finder writes the last used search term and filters to the session, so that the page will remain as expected between page loads.
Set the template key in config/laravel-find.php to change the templates used when calling <x-laravel-find::search-bar />.
The following templates are provided for out-of-the-box finding:
default => Unformatted; a good basis for full customisationgovuk => Designed for use with the GOV.UK Laravel librarybulma => Designed for use with the Bulma CSS frameworkVersion 6+ is a fundamentally different program and should not be considered a direct upgrade.
Rather than providing a single generic search area, LaravelFind is now tailored to make searching a single model easier.
The Finder class provides everything needed to support a classic table of results, which will require some work on your part to implement the UI.
You are welcome to raise any issues or questions on GitHub.
If you wish to contribute to this library, raise an issue before submitting a forked pull request.
Published under the MIT licence.