Laravel
How to get all data from database in Laravel
![get all data from database in laravel 8](https://blog.codehunger.in/wp-content/uploads/2021/04/get-all-data-from-database-in-laravel-8.png)
In this article we will learn about how to get all data from database in laravel , I will show you how to get all table in the from the database, then I will show you how to get all table column in laravel.
Get all table name from the database in laravel
In the below code I will show how we can get all tabel name from the database in laravel
$tables_list = DB::select('SHOW TABLES'); dd($tables_list);
when you run the above code, you will have output like the below one.
![all table list from database in laravel](https://blog.codehunger.in/wp-content/uploads/2021/04/image-3-1024x469.png)
Get all the column name of the given table
To the all the column name of the given table,use the below code.
$tableColumns = DB::connection()->getSchemaBuilder()->getColumnListing('Your_table_name'); dd($tableColumns);
when you run the above code you have the output like the below image.
![all the table column name from database in laravel](https://blog.codehunger.in/wp-content/uploads/2021/04/image-4.png)
You can also read: How to clear cache using URL in Laravel
Hi nice tutorial love your blog so much