Laravel 5.5 – New Features – Part 2

Posted by Rukmi Patel | August 27, 2017

php artisan migrate:fresh

We all are familiar with refresh command. This will allow us rollback and re-run all migrations. This helps when we need to re-build database in development.

Coming to Laravel 5.5, migration fresh command introduced. This will skip all down method or rollback methods, will simply drop all tables, then run through up methods.

Below command output will elaborate more:

Command output showing the differences:


$ php artisan migrate:refresh

Rolling back: 2014_10_12_100000_create_password_resets_table
Rolled back: 2014_10_12_100000_create_password_resets_table
Rolling back: 2014_10_12_000000_create_users_table
Rolled back: 2014_10_12_000000_create_users_table
Migrating: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_000000_create_users_table
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated: 2014_10_12_100000_create_password_resets_table


$ php artisan migrate:fresh

Dropped all tables successfully.
Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_000000_create_users_table
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated: 2014_10_12_100000_create_password_resets_table

Main benefit of migrate:fresh method is, it has made down method optional. You can skip down method and still quickly reset local database.


Adds Front-end Presets

Since Laravel 5.3, the framework has added optional scaffolding of Bootstrap and Vue.js. This enables developer quickly get started creating next app idea with some of the latest tools.

In Laravel 5.5, Framwork has added command line utility to add presets like React, Bootstrap Only or None so developer does not require to change files but can add presets as he likes from command prompt only!

React Preset The React preset command can be initialized through Artisan:

php artisan preset react

This will remove Vue.js scaffolding and adds react.

Bootstrap Preset = When we don’t want to include any JS scaffolding(React or Vue.js) but still wants to keep bootstrap css, this command is useful.

php artisan preset bootstrap

None Preset –  Final preset option is “none” which will remove both Bootstrap and (Vue.js or React):

php artisan preset none

 

 

 

 

Add a comment

*Please complete all fields correctly

Related Blogs

Posted by Rukmi Patel | December 2, 2019
iTreeni Technolabs Outshines at GoodFirms by Providing End-To-End Business Solutions
Empowering clients' business by leveraging technology-enabled solutions endows iTreeni Technolabs to tap into the list of top web development companies in Australia at GoodFirms. View iTreeni Technolabs' GoodFirms' profile to...
MEAN-Vs-Full-stack
Posted by Rukmi Patel | April 9, 2019
Comparing Full Stack V/S MEAN Stack approach
The web and mobile app development services have stepped up to next level in last 5 years. Web and apps are all built utilizing a ‘stack’ of various technologies like...
Posted by Rukmi Patel | September 6, 2018
Headless Drupal or DeCoupled Drupal
Now a days, front-end technologies like Angular, React.js, Backbone.js etc have started attracting audience because of its advantages over traditional rendering approach. Server side frameworks like Laravel, Node.js have already...