Get all table names inside a database and echo them using @foreach @endforeach
.
My database name is demoproject and it has some tables inside it like users, list1, list2, list3 and I need to echo all the tables.
When using var dump I get bool(true) or when echoing I get 1 with this code DB::statement('show tables from demoproject');
I'm making an admin panel, where I can edit tables and their rows. That's why I need to use @foreach
to link them to another page.
I only need to know how I can echo all tables inside that database to continue with this project.
I'm using Laravel 4.
A little bit late, however, you can run $tables = DB::select('SHOW TABLES');
to get all tables.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With