Skip to content

Commit

Permalink
Merge pull request #37 from amphetkid/patch-1
Browse files Browse the repository at this point in the history
Only build models from tables not views
  • Loading branch information
michael-mcmullen authored Feb 20, 2020
2 parents 53d384d + f6efcfd commit bd14fd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Commands/ModelFromTableCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ public function getAllTables()
$tables = [];

if (strlen($this->options['connection']) <= 0) {
$tables = collect(DB::select(DB::raw('show tables')))->flatten();
$tables = collect(DB::select(DB::raw("show full tables where Table_Type = 'BASE TABLE'")))->flatten();
} else {
$tables = collect(DB::connection($this->options['connection'])->select(DB::raw('show tables')))->flatten();
$tables = collect(DB::connection($this->options['connection'])->select(DB::raw("show full tables where Table_Type = 'BASE TABLE'")))->flatten();
}

$tables = $tables->map(function ($value, $key) {
Expand Down

0 comments on commit bd14fd3

Please sign in to comment.