Creating Model

You can create Model in Laravel using the following artisan command

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

Leave a Reply

Your email address will not be published. Required fields are marked *