Used terminal commands laravel

Used terminal commands laravel

Create a new project in laravel:

#laravel new your-project-name

Another way to create a new project:

#composer create-project laravel/laravel your-project-name

Scaffold basic login and registration views and routes – it’s a good idea to do it at the beginning of the project

#php artisan make:auth

Create a controller

#php artisan make:controller CardsController

Create a controller with all the CRUD functions

#php artisan make:controller CardsController –resource

Create a model for a table

#php artisan make:model Card

Create a request file

#php artisan make:request FlyerRequest

 

Read-Eval-Print Loop for PHP with your application’s settings already loaded:

#php artisan tinker

 

Database

Create a migration that creates a card table ->create_cards_table -> the name of migration

#php artisan make:migration create_cards_table

Create a migration that creates also a table ->create_cards_table -> the name of migration

#php artisan make:migration create_cards_table –create=cards

Migrate the file

#php artisan migrate

Reset and re-run all migrations – rollback everything and re-run from the beginning

#php artisan migrate:refresh

Rollback all database migrations

#php artisan migrate:reset

Rollback the last database migration – undo the last migration

#php artisan migrate:rollback

 

 

Other usefull commands

#sudo nano /etc/hosts

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Related Articles

Vhost and Laravel

To be able to access the new project(blog) from the localhost by accessing http://blog.local  you must find and edit the

Adding a column to an existing table – Laravel

For example we forgot to add the column password to the table users, and we already have inserted datas in

SQLSTATE[HY000] [1045] Access denied for user ‘homestead’@’localhost’ (using password: YES)

When I run the command “php artisan migrate” I get the following error message: [PDOException]  SQLSTATE[HY000] [1045] Access denied for