Skip to content

Instantly share code, notes, and snippets.

@ulhaq
ulhaq / README.md
Last active July 30, 2020 03:47
Simple Laravel Database Search

This is a simple trait for database searching.

Model

Our model should of course use the Searchable trait. Likewise, we have to declare the model attributes which shall be searchable.

namespace App;

use Illuminate\Database\Eloquent\Model;
use App\Traits\Searchable;