tooshay / laravel-model-search
Handy macro for searching text through related models.
Fund package maintenance!
tooshay
Requires
- php: ^8.0
- illuminate/contracts: ^8.0
- spatie/laravel-package-tools: ^1.4.3
Requires (Dev)
- orchestra/testbench: ^6.13
- phpunit/phpunit: ^9.3
- spatie/laravel-ray: ^1.9
- vimeo/psalm: ^4.4
This package is auto-updated.
Last update: 2025-06-19 03:11:38 UTC
README
This is a riff on Freek Spatie's model search macro that adds support for multiple search terms.
Installation
You can install the package via composer:
composer require tooshay/laravel-model-search
Usage
$results = Product::whereLike(['name', 'type.name', 'tags.name'], 'SearchTerm')->get();
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.