ibnudirsan / full-text
Full-text searching MySQL is using MATCH() AGAINST() syntax.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/ibnudirsan/full-text
This package is auto-updated.
Last update: 2025-10-04 20:39:03 UTC
README
Full-text searching is performed using MATCH() AGAINST() syntax. MATCH() takes a comma-separated list that names the columns to be searched. AGAINST takes a string to search for, and an optional modifier that indicates what type of search to perform. The search string must be a string value that is constant during query evaluation.
<?php namespace App\Model\articlesBlog; use Ibnudirsan\FullText\App\Helper\Searchable; /* |-------------------------------------------------------------------------- | Rumah Dev | Backend Developer : ibudirsan | Email : ibnudirsan@gmail.com | Copyright © RumahDev 2022 |-------------------------------------------------------------------------- */ class articlesBlog extends Model { /** * Add Searchable at Model */ use Searchable; /** * Add property $searchable */ protected $searchable = [ 'articleContent' ]; }
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Controllers\Controller; use Ibnudirsan\FullText\App\Helper\Searchable; /* |-------------------------------------------------------------------------- | Rumah Dev | Backend Developer : ibudirsan | Email : ibnudirsan@gmail.com | Copyright © RumahDev 2022 |-------------------------------------------------------------------------- */ class PostBlogsController extends Controller { use Searchable; public function search($search) { $result = articlesBlog::select('id', 'TitleArticle', 'slugArticle', 'Excerpt', 'articleContent') ->search($search) ->get(); return $result; } }