How to Create Migration in Laravel 9? (ok)
https://www.itsolutionstuff.com/post/how-to-create-migration-in-laravel-9example.html
Last updated
https://www.itsolutionstuff.com/post/how-to-create-migration-in-laravel-9example.html
Last updated
Đọc bản full (ok)
This article will provide an example of how to create database table using migration command in laravel 9. I’m going to show you how to create migration in laravel 9. In this article, we will implement a how to create table migration in laravel 9. This post will give you a simple example of laravel 9 creating a table using migration.
I will guide you how to create database table using laravel migration. we will use laravel 9 command to creating migration for table.
In this example, we will simple create "posts" table with id, title, body, is_publish, created_at and updated_at columns. we will generate new migration by laravel 9 command and add above rows. Then we will run migration and we will get table created on mysql database. so let's see bellow tutorial.
Create Migration:
Using bellow command you can simply create migration for database table.
After run above command, you can see created new file as bellow and you have to add new column for string, integer, timestamp and text data type as like bellow:
database/migrations/2022_02_17_133331_create_posts_table.php
Run Migration:
Using bellow command we can run our migration and create database table.
After that you can see created new table in your database as like bellow:
Create Migration with Table:
Run Specific Migration:
Migration Rollback:
Read Also: Laravel 9 Database Seeder Tutorial Example
I hope it can help you...