承接 globalia/laravel-scout-mysql 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

globalia/laravel-scout-mysql

Composer 安装命令:

composer require globalia/laravel-scout-mysql

包简介

MySql Driver for Laravel Scout

README 文档

README

This package is a MySQL driver for Laravel Scout.

Contents

Installation

You can install the package via composer:

composer config repositories.globalia/laravel-scout-mysql git https://github.com/globalia/laravel-scout-mysql.git

composer require "globalia/laravel-scout-mysql" "^1.0"

You must add the Scout service provider and the package service provider in your app.php config:

// config/app.php
'providers' => [
    ...
    Laravel\Scout\ScoutServiceProvider::class,
    Globalia\LaravelScoutMysql\ScoutMysqlServiceProvider::class,
],

Setting up database search indexes table:

php artisan migrate

After you've published the Laravel Scout package configuration:

// config/scout.php
// Set your driver to mysql
    'driver' => env('SCOUT_DRIVER', 'mysql'),

Usage

Here is an example of how to use the engine:

    $result = Todo::search($term)
        ->where('boost(name)', 5)
        ->where('boost(tags)', 2)
        ->where('checked', 1)
        ->where('published_at >=', \Carbon::now());

    return null === $limit ? $result->get() : $result->paginate($limit);

Instead of using the "Laravel\Scout\Searchable" trait, use this "Globalia\LaravelScoutMysql\Models\Concerns\HasSearchIndex"

otherwise you can use Laravel Scout as described in the official documentation

Searching in all models

Since the index table is a model, you can search in it directly. Each result will be hydrated to its corresponding model.

    $result = SearchIndex::search($term);

Credits

统计信息

  • 总下载量: 4
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 24
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 24
  • Watchers: 3
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-07-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固