Post Top Ad

Monday, November 20, 2017

Laravel 5 New Feature: Laravel Frontend Presets



As many of you probably know, Laravel 5.4 ships with an Example.vuecomponent in the resources/assets/js/components directory. In addition, Laravel Mix supports compiling single-file Vue components out of the box. This gives developers a quick, convenient starting point for building modern, robust JavaScript components for their applications.
For Laravel 5.5, this scaffolding is still in place, but we’re introducing some additional options for frontend scaffolding via a new artisan presetcommand.

React
If you love React, you will love Laravel 5.5. Simply run the php artisan preset react command to swap out the Vue scaffolding with React scaffolding. The default Mix configuration, components, and all other related files will be updated accordingly:

Now, instead of an Example.vue component, your application will contain an Example.js React component:




Bootstrap

Some users may not want any JavaScript scaffolding at all, but don’t want to lose the basic Bootstrap CSS scaffolding. If that’s you, you can use the artisan preset bootstrap to only remove the Vue scaffolding:

Remove All Scaffolding


Some users may even want to remove all frontend scaffoldingThe artisan preset none will remove all frontend scaffolding:



I hope you enjoy these new options!


Copyright: The purpose of this post is for learning only. 


No comments:

Post a Comment