Skip to content

Commit

Permalink
Add fix of driver name and README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Carghaez committed Jul 28, 2017
1 parent 1816755 commit 65ea244
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,14 @@ To get started with Bruno I highly recommend my article on

## Installation

For Laravel 5.3 and below
```bash
composer require optimus/bruno ~1.0
composer require optimus/bruno ~2.0
```

For Laravel 5.4 and above
```bash
composer require optimus/bruno ~3.0
```

## Usage
Expand Down Expand Up @@ -181,9 +187,9 @@ sw | Starts with | `Gior` matches `Giordano Bruno` but not `Giovanni`
ew | Ends with | `uno` matches `Giordano Bruno` but not `Giovanni`
eq | Equals | `Giordano Bruno` matches `Giordano Bruno` but not `Bruno`
gt | Greater than | `1548` matches `1600` but not `1400`
gte| Greater than or equalTo | `1548` matches `1548` and above
gte| Greater than or equalTo | `1548` matches `1548` and above (ony for Laravel 5.4 and above)
lte | Lesser than or equalTo | `1600` matches `1600` and below (ony for Laravel 5.4 and above)
lt | Lesser than | `1600` matches `1548` but not `1700`
lte | Lesser than or equalTo | `1600` matches `1600` and below
in | In array | `['Giordano', 'Bruno']` matches `Giordano` and `Bruno` but not `Giovanni`

**Special values**
Expand Down
3 changes: 1 addition & 2 deletions src/EloquentBuilderTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use DB;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Support\Facades\Config;
use InvalidArgumentException;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Str;
Expand Down Expand Up @@ -99,7 +98,7 @@ protected function applyFilter(Builder $queryBuilder, array $filter, $or = false
// $value, $not, $key, $operator
extract($filter);

$dbType = Config::get('database.default');
$dbType = $queryBuilder->getConnection()->getDriverName();

$table = $queryBuilder->getModel()->getTable();

Expand Down

0 comments on commit 65ea244

Please sign in to comment.