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

Laravel Class not found

i tried lots of things… and after 2 hours here is the solutions php artisan config:cache composer dump-autoload php artisan

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

Add PATH so the laravel executable can be located by your system

A first problem for me was thatI didn;t know where to add ~/.composer/vendor/bin . I searched on the internet and I