Thursday, January 25, 2018

Front-end Presets for Older Laravel Frameworks

Preset is a new artisan command that provides opinionated scaffolding for various front-end frameworks/libraries such as React, Bootstrap, and Vue.js. This command is very helpful if your projects want to scaffold from the default Laravel's front-end framework, Vue.js, to something else like React. This command also provides you a way to remove all of the presets by running the command: php artisan preset none. At the time of writing, preset artisan command is only available for Laravel 5.5.

Projects that still run on PHP 5 can't use Laravel later than 5.4. Yet, some web hostings still not support PHP 7. Thus, most of them 'stuck' on Vue.js preset.

Of course, you can't be stuck to a front-end framework just because there is no preset artisan command. You can just set up your package.json manually by using npm command and by adding required packages one by one. What if you don't want the hassle of setting up the npm packages?

Laravel

Friday, January 19, 2018

How to Rename Multiple Files Efficiently

Sometimes we want to rename a bulk of files at once. Windows Explorer provides this bulk renaming feature. We can select the files we want to rename (Ctrl + Left click) then press F2 to enter the new name for them. Windows Explorer renames the each of the files with new name plus a numbering.

Rename files with Windows Explorer

Friday, November 18, 2016

How to Delete a Very Deep Directory Efficiently

In the daily routine of your job, you may have to deal with a directory that has levels very much, that is, the directory is very deep. This situation may often occur to those who use NPM which produces a node_modules directory that has a lot of levels.

Very Deep Directory Structure Image
Very Deep Directory Structure

This directory is the same as the other directories until you realize that actually, this directory requires special treatment to remove, especially on Windows operating systems. This directory cannot be removed immediately. You must remove the sub-directory at a certain level before you delete the directory. This is very inefficient and can slow down your performance.