Laracademy\Generators\Commands\ModelFromTableCommand::getAllTables PHP Method

getAllTables() public method

will return an array of all table names.
public getAllTables ( )
    public function getAllTables()
    {
        $tables = [];
        if (strlen($this->options['connection']) <= 0) {
            $tables = collect(DB::select(DB::raw('show tables')))->flatten();
        } else {
            $tables = collect(DB::connection($this->options['connection'])->select(DB::raw('show tables')))->flatten();
        }
        $tables = $tables->map(function ($value, $key) {
            return collect($value)->flatten()[0];
        })->reject(function ($value, $key) {
            return $value == 'migrations';
        });
        return $tables;
    }