Laravel Useful Route Flags and Options

Laravel makes adding a new route a piece of cake 馃槑. To view all the routes we have been using php artisan route:list and this list becomes quite messy and hard to read as the route keeps growing. Some of the common options Using path and name options 1 2 3 php artisan route:list --path="login" php artisan route:list --name="login" 鈥揷ompact flag 1 php artisan route:list --compact This command shows only Method, URI and Action....

August 18, 2021 路 1 min 路 Me

Composer | composer.lock

If you鈥檙e familiar with composer then, you will always find composer.lock in the root source of your project. This file contains the list of installed dependencies of your project. composer.lock ensures everyone working on your project is running with the same dependencies versions. Now, we get the idea of why commit the composer.lock file to git. It may confuse you that we are already using a specific version in composer.json. Yes, we do, but the dependencies also require other dependencies that are not bound by these constraints....

August 8, 2021 路 1 min 路 Me

When And How to Use Database Transactions in Laravel

Hello Artisan 馃槑 , Database transactions are often an overlooked feature, but Laravel makes it so effortless. One of the powerful ways to ensure data integrity is database transactions. Database transactions give a powerful ability to safely perform multiple database queries in a single transaction. If all queries run smoothly, then only it will commit otherwise it will roll back. For Example, we have an application where we create a user, assign a role to the created user, and add KYC (Know your customer)....

August 4, 2021 路 2 min 路 Me

How to Turn on Error Reporting in Wordpress

You got an error. The first thing we do is to check the error logs or reports. The logs or reports make it the developer or any tech guy easy to solve the problems. Today we will enable some of the hidden variables which can help us debug the WordPress errors more easily. These variables are mostly enabled only for the development process, not on production websites. Let鈥檚 get to the point now....

July 31, 2021 路 1 min 路 Me

Why Wordpress Prefer array() Instead of Short Array Syntax

Short array syntax [] was introduced a while back when PHP 5.4 was released. Basically it is ability to define arrays using [] instead of array(). 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 <?php $arr1 = array( 'motto' => 'learning is fun.', 'url' => 'raisachin.com.np' ); $arr2 = [ 'motto' => 'learning is fun.', 'url' => 'raisachin.com.np' ]; echo '<pre>'; print_r($arr1); echo '</pre>'; Using any of the above will result the same output....

July 31, 2021 路 1 min 路 Me