https://github.com/dillingham/searchable
basic search functioality
https://github.com/dillingham/searchable
laravel php
Last synced: 3 months ago
JSON representation
basic search functioality
- Host: GitHub
- URL: https://github.com/dillingham/searchable
- Owner: dillingham
- License: mit
- Created: 2019-10-12T15:35:44.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-12T15:51:07.000Z (over 6 years ago)
- Last Synced: 2025-06-05T11:06:04.818Z (about 1 year ago)
- Topics: laravel, php
- Language: PHP
- Homepage:
- Size: 1.95 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# Searchable
```
composer require dillingham/searchable
```
- add `Searchable` to model(s)
- add `$table->longText('search');` to migration
- add `Model::searchIndex()` to migration
- add `->appendSearch($content)` to observer
example
```php
// on post save
$post->appendSearch($post->content);
// on comment save
$comment->post->appendSearch($comment->body);
```