Created
January 24, 2018 19:15
-
-
Save isaqueprofeta/d2ad925704570a4be567fbd3893cb74e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\Facades\DB; | |
$query = "SELECT tables.table_name, columns.column_name, columns.data_type, columns.udt_name FROM information_schema.tables AS tables JOIN information_schema.columns AS columns ON tables.table_name = columns.table_name WHERE tables.table_type = 'BASE TABLE' AND tables.table_schema NOT IN ('pg_catalog', 'information_schema')"; | |
$data = json_decode(collect(DB::select($query))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment