Recover Lost Laravel Migration Files From an Existing Database

While working on one of my client projects, I was shocked to see as there were no migration files in a Laravel project. They provided me the live database to work with and it was somehow okay for now but we all know what migration files do in Laravel. It was itching me and I started researching for generating the migration files by using our existing database. Here comes to the rescue, one of the packages by Bennett Treptow was just what I was looking for....

April 22, 2022 · 1 min · Me

Composer🌙Useful Commands

View the config list 1 composer config --list Checking common errors to help debug problems 1 composer diagnose Show the list of outdated packages 1 composer outdated Show information about installed dependencies 1 composer info 1 composer show For specific dependencies 1 composer show intervention/image Dependencies available 1 composer show --all Navigation Show dependency homepage or repo url 1 composer browse intervention/image --show Navigate to dependency homepage url 1 composer browse intervention/image --homepage Navigate to dependency repo url 1 composer browse intervention/image To be continued … 😄

August 16, 2021 · 1 min · Me

How to Cause an Intentional Error Php

Hello, the topic about getting an intentional error is not so often you look up to but sometimes you need it to make sure the error is handled correctly. Let’s dive into the content directly. 1 trigger_error("Error Triggered!", E_USER_ERROR); DOC Reference 1 2 3 4 5 6 7 <?php try { trigger_error("Error Triggered!", E_USER_ERROR); } catch(Exception $e) { echo 'Message: ' .$e->getMessage(); } Above code will give you an triggered fatal error....

April 7, 2022 · 1 min · Me

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" –compact 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’re 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