Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

Auto format or Masking phone number or te input field

Just take a tel input field, you can take text input also. But as I’m working with phone numbers, I am using tel input as below   <form> <label for=”#phone-number”>Phone number<span class=”required”>*</span></label> <input id=”phone-number” type=”tel” value=”” name=”phone_number” aria-label=”Please enter your phone number” placeholder=”ex. 1(111)-111-1111″ onkeyup=”phoneMask(this) “> </form>   We need to write a few lines […]

gitignore .env not working – remove cache from git history

Problem: I want git to ignore the .env file that contains my local development environment configuration. I’m using git in VS Code editor. This is how the .env file is listed in the .gitignore file. *.env .env But it keeps syncing with the git repository. And every time the code has been merged, the staging […]

How to get the latest and oldest record in Laravel Eloquent through ofMany.

Laravel ships with many awesome and time-saving methods for developers like us.. Here we will see some “One of Many” function’s examples:   Get the latest/last record from a model/relation function latestRecord() { return $this->hasOne(RelationModel::class)->latestOfMany(); } Get the oldest/first record from a model/relation function latestRecord() { return $this->hasOne(RelationModel::class)->oldestOfMany(); }   Bonus!: Retrieve records with special […]

Copy or duplicate a row in Laravel project

I have been working on an application named “EasySME” with Laravel & MySQL. And a client requested a new feature that he wants to clone/copy/duplicate the existing Invoice. So, I have done a few searches and R&D and found out that Laravel ships with a built-in function called replicate(). Laravel is awesome, you want it […]

Disable chrome extension’s JS when debugging in development tools

While I was debugging a vuejs application, I got so many unnecessary steps for the chrome extension’s JS file that it took a lot of time to debug. And I need those extensions too for my development and regular work. So I was looking for a solution that how to disable or bypass the extension’s […]

How to get or export SQL query from Laravel migration file?

Hey there.. hope you are facing the same problem as I am facing to update the DB from phpMyAdmin.. and no ssh access from Cpanel to run the migration command on the terminal. And you are in the right place.. here is the solution to get the dump query from the Laravel migration file. Command: […]

Wordpress Social Share Plugin powered by Ultimatelysocial