Skip to content

Commit

Permalink
Update InputConfig.php
Browse files Browse the repository at this point in the history
Updated the way in which table columns are identified. Now works on both MySQL and Sqlite.
  • Loading branch information
johnrich85 committed Jun 7, 2016
1 parent dd91e0c commit e9c3081
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/InputConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,10 @@ public function setFilterableFields(\Illuminate\Database\Eloquent\Builder $build
{
$table = $builder->getModel()->getTable();

$columns = DB::select(
DB::raw('SHOW COLUMNS FROM ' . $table)
);
$columns = DB::getSchemaBuilder()->getColumnListing($table);

foreach($columns as $col){
$field = $col->Field;
$this->filterableFields[$field] = $field;
foreach ($columns as $col) {
$this->filterableFields[$col] = $col;
}
}
}
}

0 comments on commit e9c3081

Please sign in to comment.