Today, We want to share with you Laravel Create Table using Migration and model.In this post we will show you laravel migration truncate table, hear for Laravel : Create Model with Migration, Controller and generate DB Table we will give you demo and example for implement.In this post, we will learn about How to Create Table using Migration in Laravel? with an example.
Laravel Create Table using Migration and model
There are the Following The simple About laravel migration add column after Full Information With Example and source code.
As I will cover this Post with live Working example to develop Migrations & Seeding – Laravel – The PHP Framework, so the Artisan, creating tables in database is used for this example is following below.
Step 1: Make a Database Migration:
create migration for database table.
php artisan make:migration create_hospitals_table
Step 2: created new file
database/migrations/2025_08_03_064006_create_hospitals_table.php
$table->string('docator_name'); $table->text('locations'); $table->boolean('status')->default(0); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('hospitals'); } }
step 3: Run Migration:
simple run our simple migration as well as create database table.
php artisan migrate
Create new Model
php artisan make:model Hospital -mr
Step 4: Extra Tips
Create Migration for database table:
php artisan make:migration create_hospitals_table --table=hospitals
Run Specific Migration for database table:
php artisan migrate --path=/database/migrations/2025_08_03_064006_create_hospitals_table.php
Migration for database table Rollback:
php artisan migrate:rollback
Web Programming Tutorials Example with Demo
Read :
Summary
You can also read about AngularJS, ASP.NET, VueJs, PHP.
I hope you get an idea about Creating database table in laravel using migrationlaravel migration add column after, laravel migration change column type.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.