hassamulhaq / laravel-model-relation-search
Laravel package to search via your models and model relations.
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/hassamulhaq/laravel-model-relation-search
Requires
- php: ^8.1
- illuminate/database: ^10.4
- illuminate/support: ^10.4
This package is not auto-updated.
Last update: 2025-12-18 00:29:05 UTC
README
Laravel package to search via your models and model relations.
installation :
composer required hassamulhaq/laravel-model-relation-search
Usage :
- Use
ModelRelationSearchableTraittrait in your model. - Define
$searchable_columnsproperty in your model to select which columns to search in.
Example :
use HassamUlHaq\LaravelModelRelationSearch\ModelRelationSearchableTrait; class Book extends Model { use ModelRelationSearchableTrait; protected $searchable_columns = [ 'title', 'author.bio', //'author.companies.name' ]; public function authors() { return $this->hasOne(Author::class); }