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

php artisan tinker

This terminal command provides a REPL (Read-Eval-Print Loop) for PHP with your application’s settings already loaded: php artisan tinker You

gulp: command not found

After some hours of searching I found the fix and explanation here: http://blog.dwaynecrooks.com/post/110903139442/why-do-we-need-to-install-gulp-globally-and   # Step 1 npm install -g

php artisan migrate – error [PDOException] SQLSTATE[HY000] [2002] No such file or directory

/Applications/AMPPS/www/blog/config/database.php I changed the host from localhost into 127.0.0.1 and it worked: ‘host’ => env(‘DB_HOST’, ‘127.0.0.1’),