Creating Model

You can create Model in Laravel using the following artisan command
This will create a Model named Post

If you want to create the models inside Models folder you can use the following command

Model will be created at App/Models/Post.php

Above code will create a model named “POST” with migration file
You can see the migration file created at database\migrations folder

I have edited the file to introduce name and text fields to Post model

Now you can run the migrate

This will create the table in the database provided that you have the correct database setting in the .env file

You can have the following data types when you update your migration file