Skip to content

Commit f9ceeb9

Browse files
committed
Namespace udpates
Updaing the namespace of the package to Yab
1 parent c1a0736 commit f9ceeb9

17 files changed

+61
-60
lines changed

README.md

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
**Unfortunately I do not have much time to give this package the attention it needs.
2-
If you are interested in taking over this package please contact me at damian@troyweb.com**
3-
41
Laravel Scout MySQL Driver
52
==========================
63

7-
Search Eloquent Models using MySQL `FULLTEXT` Indexes or `WHERE LIKE '%:search%`' statements.
4+
Search Eloquent Models using MySQL `FULLTEXT` Indexes or `WHERE LIKE '%:search%`' statements.
85

96
1. [Installation](#installation)
107
2. [Usage](#usage)
@@ -18,12 +15,12 @@ Installation <div id="installation"></div>
1815

1916
**Note: Any Models you plan to search using this driver must use a MySQL MyISAM or InnoDB table.**
2017

21-
If you haven't already you should [install Laravel Scout](https://laravel.com/docs/5.3/scout#installation) to
18+
If you haven't already you should [install Laravel Scout](https://laravel.com/docs/5.3/scout#installation) to
2219
your project and apply the `Laravel\Scout\Searchable` trait to any Eloquent models you would like to make searchable.
2320

2421
Install this package via **Composer**
25-
26-
`composer require damiantw/laravel-scout-mysql-driver`
22+
23+
`composer require yab/laravel-scout-mysql-driver`
2724

2825

2926
Next add the ServiceProvider to the Package Service Providers in `config/app.php`
@@ -32,7 +29,7 @@ Next add the ServiceProvider to the Package Service Providers in `config/app.php
3229
/*
3330
* Package Service Providers...
3431
*/
35-
DamianTW\MySQLScout\Providers\MySQLScoutServiceProvider::class,
32+
Yab\MySQLScout\Providers\MySQLScoutServiceProvider::class,
3633
```
3734

3835
Append the default configuration to `config/scout.php`
@@ -81,16 +78,16 @@ Simply call the `search()` method on your `Searchable` models:
8178

8279
`$beers = App\Drink::search('beer')->get();`
8380

84-
Or With pagination:
81+
Or With pagination:
8582

8683
`$beers = App\Drink::search('beer')->paginate(15);`
8784

88-
Simple constraints can be applied using the `where()` builder method
85+
Simple constraints can be applied using the `where()` builder method
8986
(each additional `WHERE` will be applied using `AND`).
9087

9188
`$beers = App\Drink::search('beer')->where('in_stock', 1)->get();`
9289

93-
The following operators can be applied to the `WHERE` statements: `<> != = <= < >= >`
90+
The following operators can be applied to the `WHERE` statements: `<> != = <= < >= >`
9491
(`=` will be used if no operator is specified)
9592

9693
`$beers = App\Drink::search('beer')->where('abv >', 10)->get();`
@@ -100,13 +97,13 @@ For more usage information see the [Laravel Scout Documentation](https://laravel
10097
Modes <div id="modes"></div>
10198
-----
10299

103-
This driver can perform different types of search queries depending on the mode set in the `scout.mysql.mode`
100+
This driver can perform different types of search queries depending on the mode set in the `scout.mysql.mode`
104101
Laravel configuration value. Currently 4 different modes are supported `NATURAL_LANGUAGE`,`BOOLEAN`,`LIKE` and `LIKE_EXPANDED`.
105102

106103

107104
### NATURAL_LANGUAGE and BOOLEAN Modes
108105

109-
In `NATURAL_LANGUAGE` and `BOOLEAN` mode the driver will run MySQL `WHERE MATCH() AGAINST()` queries in the
106+
In `NATURAL_LANGUAGE` and `BOOLEAN` mode the driver will run MySQL `WHERE MATCH() AGAINST()` queries in the
110107
respective modes.
111108

112109
Both modes search queries will include all of Model's `FULLTEXT` compatible fields (`CHAR`,`VARCHAR`,`TEXT`)
@@ -138,12 +135,12 @@ select * from `posts` where MATCH(content,meta) AGAINST(? IN BOOLEAN MODE)
138135
Operators for `BOOLEAN` mode should be passed as part of the search string.
139136

140137

141-
For more information see the
138+
For more information see the
142139
[MySQL's Full-Text Search Functions documentation](http://dev.mysql.com/doc/refman/5.7/en/fulltext-search.html).
143140

144141
### LIKE and LIKE_EXPANDED Modes
145142

146-
`LIKE` and `LIKE_EXPANDED` modes will run `WHERE LIKE %?%` queries that will include all of the Model's fields
143+
`LIKE` and `LIKE_EXPANDED` modes will run `WHERE LIKE %?%` queries that will include all of the Model's fields
147144
returned from `toSearchableArray()`. `LIKE_EXPANDED` mode will query each field using each individual word in the search string.
148145

149146
For example running a search on a `Customer` model with the following database structure:
@@ -169,23 +166,23 @@ SELECT * FROM `customers` WHERE (`id` LIKE '%John%' OR `id` LIKE '%Smith%' OR `f
169166
Console Command <div id="console-command"></div>
170167
---------------
171168

172-
The command `php artisan scout:mysql-index {model?}` is included to manage the `FULLTEXT` indexes needed for
173-
`NATURAL_LANGUAGE`and `BOOLEAN` modes.
169+
The command `php artisan scout:mysql-index {model?}` is included to manage the `FULLTEXT` indexes needed for
170+
`NATURAL_LANGUAGE`and `BOOLEAN` modes.
174171

175172
If the model parameter is omitted the command will run with all Model's with the `Laravel\Scout\Searchable` trait
176173
and a MySQL connection within the directories defined in the `scout.mysql.model_directories` Laravel configuration value.
177174

178175
### Creating Indexes
179176

180-
Pass the command a Model to create a `FULLTEXT` index for all of the Model's `FULLTEXT` compatible fields
177+
Pass the command a Model to create a `FULLTEXT` index for all of the Model's `FULLTEXT` compatible fields
181178
(`CHAR`,`VARCHAR`,`TEXT`) returned from the Model's `toSearchableArray()` method. The index name will be the result of
182-
the Model's `searchableAs()` method.
179+
the Model's `searchableAs()` method.
183180

184181
If an index already exists for the Model and the Model contains new searchable fields not in the existing index the
185182
index will be dropped and recreated.
186183

187184
`php artisan scout:mysql-index App\\Post`
188-
185+
189186
### Dropping index
190187

191188
Pass the `-D` or `--drop` options to drop an existing index for a Model.
@@ -201,21 +198,21 @@ Behavior can be changed by modifying the `scout.mysql` Laravel configuration val
201198
`NATURAL_LANGUAGE`,`BOOLEAN`,`LIKE` and `LIKE_EXPANDED`.
202199

203200
* `scout.mysql.model_directories` - If no model parameter is provided to the included `php artisian scout:mysql-index`
204-
command the directories defined here will be searched for Model's with the `Laravel\Scout\Searchable` trait
201+
command the directories defined here will be searched for Model's with the `Laravel\Scout\Searchable` trait
205202
and a MySQL connection.
206203

207-
* `scout.mysql.min_search_length` - If the length of a search string is smaller then this value no search queries will
204+
* `scout.mysql.min_search_length` - If the length of a search string is smaller then this value no search queries will
208205
run and an empty Collection will be returned.
209206

210-
* `scout.mysql.min_fulltext_search_length` - If using `NATURAL_LANGUAGE` or `BOOLEAN` modes and a search string's length
211-
is less than this value the driver will revert to a fallback mode. By default MySQL requires a search string length of at
212-
least 4 to to run `FULLTEXT` queries. For information on changing this see the
207+
* `scout.mysql.min_fulltext_search_length` - If using `NATURAL_LANGUAGE` or `BOOLEAN` modes and a search string's length
208+
is less than this value the driver will revert to a fallback mode. By default MySQL requires a search string length of at
209+
least 4 to to run `FULLTEXT` queries. For information on changing this see the
213210
[MySQL's Fine-Tuning MySQL Full-Text Search documentation](http://dev.mysql.com/doc/refman/5.7/en/fulltext-fine-tuning.html).
214211

215-
* `scout.mysql.min_fulltext_search_fallback` - The mode that will be used as a fallback when the search string's length
212+
* `scout.mysql.min_fulltext_search_fallback` - The mode that will be used as a fallback when the search string's length
216213
is less than `scout.mysql.min_fulltext_search_length` in `NATURAL_LANGUAGE` or `BOOLEAN` modes. Acceptable values are
217214
`LIKE` and `LIKE_EXPANDED`.
218215

219216
* `scout.mysql.query_expansion` - If set to true MySQL query expansion will be used in search queries. Only applies if
220-
using `NATURAL_LANGUAGE` mode. For more information see
221-
[MySQL's Full-Text Searches with Query Expansion documentation](http://dev.mysql.com/doc/refman/5.7/en/fulltext-query-expansion.html).
217+
using `NATURAL_LANGUAGE` mode. For more information see
218+
[MySQL's Full-Text Searches with Query Expansion documentation](http://dev.mysql.com/doc/refman/5.7/en/fulltext-query-expansion.html).

composer.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{
2-
"name": "damiantw/laravel-scout-mysql-driver",
2+
"name": "yab/laravel-scout-mysql-driver",
33
"description": "MySQL driver for Laravel Scout.",
44
"license": "MIT",
55
"authors": [
66
{
77
"name": "Damian Crisafulli",
88
"email": "damian.crisafulli@troyweb.com"
9+
},
10+
{
11+
"name": "Matt Lantz",
12+
"email": "matt@yabhq.com"
913
}
1014
],
1115
"minimum-stability": "dev",
@@ -16,7 +20,7 @@
1620
},
1721
"autoload": {
1822
"psr-4": {
19-
"DamianTW\\MySQLScout\\": "src/"
23+
"Yab\\MySQLScout\\": "src/"
2024
},
2125
"files": [
2226
"src/helpers.php"

src/Commands/ManageIndexes.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
namespace DamianTW\MySQLScout\Commands;
3+
namespace Yab\MySQLScout\Commands;
44

55
use Illuminate\Console\Command;
6-
use DamianTW\MySQLScout\Services\IndexService;
6+
use Yab\MySQLScout\Services\IndexService;
77
use Illuminate\Contracts\Events\Dispatcher;
8-
use DamianTW\MySQLScout\Events;
8+
use Yab\MySQLScout\Events;
99

1010
class ManageIndexes extends Command
1111
{

src/Engines/Modes/Boolean.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
namespace DamianTW\MySQLScout\Engines\Modes;
3+
namespace Yab\MySQLScout\Engines\Modes;
44

55
use Laravel\Scout\Builder;
6-
use DamianTW\MySQLScout\Services\ModelService;
6+
use Yab\MySQLScout\Services\ModelService;
77

88
class Boolean extends Mode
99
{

src/Engines/Modes/Like.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
namespace DamianTW\MySQLScout\Engines\Modes;
3+
namespace Yab\MySQLScout\Engines\Modes;
44

55
use Laravel\Scout\Builder;
6-
use DamianTW\MySQLScout\Services\ModelService;
6+
use Yab\MySQLScout\Services\ModelService;
77

88
class Like extends Mode
99
{

src/Engines/Modes/LikeExpanded.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
namespace DamianTW\MySQLScout\Engines\Modes;
3+
namespace Yab\MySQLScout\Engines\Modes;
44

55
use Laravel\Scout\Builder;
6-
use DamianTW\MySQLScout\Services\ModelService;
6+
use Yab\MySQLScout\Services\ModelService;
77

88
class LikeExpanded extends Mode
99
{

src/Engines/Modes/Mode.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
namespace DamianTW\MySQLScout\Engines\Modes;
3+
namespace Yab\MySQLScout\Engines\Modes;
44

55
use Laravel\Scout\Builder;
6-
use DamianTW\MySQLScout\Services\ModelService;
6+
use Yab\MySQLScout\Services\ModelService;
77

88
abstract class Mode
99
{
@@ -25,7 +25,7 @@ abstract public function isFullText();
2525
protected function buildWheres(Builder $builder)
2626
{
2727
$this->whereParams = null;
28-
28+
2929
$queryString = '';
3030

3131
$parsedWheres = $this->parseWheres($builder->wheres);

src/Engines/Modes/ModeContainer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace DamianTW\MySQLScout\Engines\Modes;
3+
namespace Yab\MySQLScout\Engines\Modes;
44

55
class ModeContainer
66
{

src/Engines/Modes/NaturalLanguage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace DamianTW\MySQLScout\Engines\Modes;
3+
namespace Yab\MySQLScout\Engines\Modes;
44

55
use Laravel\Scout\Builder;
66

src/Engines/MySQLEngine.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace DamianTW\MySQLScout\Engines;
3+
namespace Yab\MySQLScout\Engines;
44

5-
use DamianTW\MySQLScout\Engines\Modes\ModeContainer;
5+
use Yab\MySQLScout\Engines\Modes\ModeContainer;
66
use Illuminate\Database\Eloquent\Collection;
77
use Laravel\Scout\Builder;
88
use Laravel\Scout\Engines\Engine;

0 commit comments

Comments
 (0)