2017 © Pedro Peláez
 

library mysql-fulltext-laravel

Let Laravel elegantly create MySQL fulltext index.

image

huang-yi/mysql-fulltext-laravel

Let Laravel elegantly create MySQL fulltext index.

  • Sunday, January 8, 2017
  • by coodeer
  • Repository
  • 1 Watchers
  • 10 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

MySQL-Fulltext-Laravel

MySQL很早以前就已经支持fulltext索引了,但是Laravel的Schema并没有为此提供便捷的创建方法,该拓展包就是为了解决这一痛点的:让Laravel的数据迁移优雅地创建MySQL的fulltext索引。, (*1)

版本

由于目前只在Laravel5.3环境下测试过,所以暂时不支持其他版本,后续会更新。, (*2)

Fulltext Laravel PHP
1.0.x 5.3.* >=5.6.4

安装

方法一,直接使用composer安装:, (*3)

$ composer require huang-yi/mysql-fulltext-laravel:1.0.*, (*4)

方法二,在项目根目录的composer.jsonrequire属性添加:, (*5)

{
    "require": {
        "huang-yi/mysql-fulltext-laravel": "1.0.*"
    }
}

然后运行:, (*6)

$ composer update

使用

php artisan make:migration命令生成迁移文件后,需要替换原有的Facade与Blueprint类。可参考以下代码:, (*7)

<?php

use HuangYi\MySqlFulltext\Blueprint;
use HuangYi\MySqlFulltext\Schema;
use Illuminate\Database\Migrations\Migration;

class CreatePostsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('posts', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title');
            $table->text('content');
            $table->timestamps();

            $table->fulltext(['title', 'content']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('posts');
    }
}

支持

Bugs和问题可提交至Github,或者请联系作者黄毅(coodeer@163.com), (*8)

License

The MySQL-Fulltext-Laravel is open-sourced software licensed under the MIT license, (*9)

The Versions

08/01 2017

1.0.x-dev

1.0.9999999.9999999-dev

Let Laravel elegantly create MySQL fulltext index.

  Sources   Download

MIT

The Requires

 

by Huang Yi

laravel mysql fulltext

08/01 2017

dev-master

9999999-dev

Let Laravel elegantly create MySQL fulltext index.

  Sources   Download

MIT

The Requires

 

by Huang Yi

laravel mysql fulltext

08/01 2017

dev-develop

dev-develop

Let Laravel elegantly create MySQL fulltext index.

  Sources   Download

MIT

The Requires

 

by Huang Yi

laravel mysql fulltext

08/01 2017

1.0.0

1.0.0.0

Let Laravel elegantly create MySQL fulltext index.

  Sources   Download

MIT

The Requires

 

by Huang Yi

laravel mysql fulltext