Laravel Programming: How to work Laravel Environments and Configuration Procedure

0
125

Environmental System

Go to Root Directory called file – .env and Open it into your IDE Editor

  1. Change your Host Name
  2. Change Database Name
  3. Change Database Password

Then Go to – root/config/database.php

Find out the Code into database.php

Change  ‘default’ => env(‘DB_CONNECTION’, ‘mysql’)    to    ‘default’ => env(‘DB_CONNECTION’, ‘sqlite’)  on database.php file

Database Migration

Laravel Database Migration is very powerful feature. Database migration is on Folder – root/database/migrations/….

In default system there still two migration Files are called :

  1. _create_users_table
  2. _create_password_resets_table

Database Migration Command Mode:  php artsian migrate

then command : php artisan migrate:rollbak

To help all migration command cell code:

Create a New Database Migration Table:

Run the code into your command shell to create table articles

After run the command shell it will create table – root/database/migration/_create_articles_table.php

Default Php Migrate Code When make Migrate atricle table:

Then add some code into php function up() into _articles.php table

Now we can migrate database tabele using code: