public function scopeKeywords($query, $keyword)
    {
        return $query->where(function ($query) use ($keyword) {
            $query->where('name', 'LIKE', "%$keyword%")
            ->orWhere('description', 'LIKE', "%$keyword%");
        });
    }
public function scopeKeywords($query, $keyword)
    {
        return $query->where(function ($query) use ($keyword) {
            $query->where('name', 'LIKE', "%$keyword%")
            ->orWhere('description', 'LIKE', "%$keyword%");
        });
    }
public function scopeKeywords ( $ query , $ keyword ) { return $ query -> where ( function ( $ query ) use ( $ keyword ) { $ query -> where ( 'name' , 'LIKE' , "%$keyword%" ) -> orWhere ( 'description' , 'LIKE' , "%$keyword%" ) ; } ) ; }
Search the name and description of items for specific keywords.

@param \Illuminate\Database\Eloquent\Builder $query
@param string                                $keyword

@return \Illuminate\Database\Eloquent\Builder
Search the name and description of items for specific keywords .