Dec 12, 2022
For whatsoever reason, you may want to check the existence of a table in your database. You can easily achieve this by using one of Laravel's schema builder method hasTable(). The Laravel schema builder hasTable() method accepts one argument, the name of the table to check.
You can use this example with the versions of laravel 6, laravel 7, laravel 8, and laravel 9.
This is optional; however, if you have not created the laravel app, then you may go ahead and execute the below command:
composer create-project laravel/laravel example-app
You might want to check out our lesson on creating table fields by clicking here. To extract the table and call the fields, we employ the model class.
class ProductController extends Controller
* Write code on Method
* @return response()
public function index()
I hope it can help you...