Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Full text search laravel mongodb

<?php

namespace AppFiltersReport;

use Closure;

class Name
{
    public function handle($request, Closure $next)
    {
        if (!request()->has('name') || request()->input('name') == null) {
            return $next($request);
        }

        return $next($request)->whereRaw(
            ['$text' => ['$search' => request()->input('name')]]
        );
    }
}
Comment

PREVIOUS NEXT
Code Example
Php :: laravel check if model has relation 
Php :: Uninitialized string offset 
Php :: ?: php 
Php :: php mysqli date between 
Php :: get chmod of directory php 
Php :: php get file from another server 
Php :: how to use model not found exception handler laravel 
Php :: mssql php 
Php :: readable date in php 
Php :: Laravel unique with Validation rule 
Php :: Add current year on WordPress using Shortcode 
Php :: laravel collection pop 
Php :: Laravel get all parent categories for each category 
Php :: paginate array before more results php 
Php :: jsondecode 
Php :: xdebug phpstorm 
Php :: laravel search and return record with pagination 
Php :: decode a nested JSON with php 
Php :: php enablem mod 
Php :: php last of string till / 
Php :: wordpress shortcode api 
Php :: php variable definition 
Php :: laravel 6 use username instead of id 
Php :: autoloading classes 
Php :: Creating dynamic subdomain in php 
Php :: php header 
Php :: trim php 
Php :: get city name from latitude and longitude in php using geocode api 
Php :: require password confirm laravel 
Php :: Best testing tools for php 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =