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

FatalErrorException in Str.php line 395: Call to undefined function Illuminate\Support\ctype_lower()

the fix is to enable the extension ctype from php.ini before after   and restart the apache serve.

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

This package requires php <=7.0.27 but your PHP version (7.0.30) does not satisfy that requirement.

At some projects when I tried: php composer install it gives me the following error: – This package requires php