Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

Laravel: php artisan commands

Here I am trying to list all Laravel PHP Artisan commands one by one for my reference and your too.

 

– To create and update table by migration

php artisan make:migration Create_Table_Name  -> create a new table

php artisan make:migration Update_Table_Name_Column_Name -> update table

php artisan make:migration Add_Column_Name_Table_Name  -> add a new column to a table

 

– To create a Controller

php artisan make:controller pathControllerName –resource

path = directory/place of the controller, i usually create controller directory wise . i.e.: site/SiteController – all site related controller will store here and admin/AdminController – all admin related controller will store here or test/TestController – all test related controller will store here.

ControllerName = Name of the controller

–resource = a parameter to create controller with default CRUD functions (index, create, store, show, edit, update, destroy)

 

– To create a Model

php artisan make:model pathModelName

path = directory/place of the model (optional). Same as controller

ControllerName = Name of the model

 

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Wordpress Social Share Plugin powered by Ultimatelysocial