Full-Text in Laravel
Laravel supports full-text search via whereFullText() in Eloquent queries and fullText() in migrations.
Laravel supports full-text search via whereFullText() in Eloquent queries and fullText() in migrations.
// Migration
$table->fullText(['title', 'body']);
// Eloquent query
Article::whereFullText(['title', 'body'], 'mysql performance')->get();
// With options
Article::whereFullText(['title', 'body'], '+mysql -oracle', [
'mode' => 'boolean',
])->get();
Laravel's whereFullText maps directly to MATCH AGAINST under the hood.