Month: July 2023

How to undo git add before commit

How to undo git add before commit

In this article lets understand how to undo git add before commit. There are times when we have added few files via git add and not committed yet and now we don’t need to stage them for commit. So, we can do this using “git reset” command. Let’s understand how to do that step by …

How to rename a git branch

How to rename a git branch

In this article lets understand how to rename a git branch. So, there can be two types of situations where you will have only local branch to rename or the branch you have already pushed to the remote repository. Let’s understand how to do it. Follow below steps: 1 ) Move to another branch. Although …

How to delete git branch locally and remotely

How to delete git branch locally and remotely

In this article lets understand how to delete git branch locally and remotely. So, there can be two types of situations where you want to delete specific branch from git. Such as, Let’s understand both one by one. 1 ) Delete the branch locally: Check below command to remove local branch. There is one more …

How to undo last commit in git

How to undo last commit in git

In this article lets understand how to undo last commit in git. There are times when we have committed few changes to git but then realized we didn’t need them and had to reset last changes. Manipulating with commit in such situations is a big headache. But if you have understood the git commits it …

How to use localization in laravel multilanguage support

How to use localization in laravel multilanguage support

In this article let’s understand How to use localization in laravel multilanguage support. Let’s understand through steps: Step 1 : Create local files First of all lets create language files at resources/lang/{en.json, fr.json}. Checkout below structure. Configure and check locale at “config/app.php” Step 2 : Create middleware We need to apply this middleware to filter …

How to use HTTP in laravel to make requests

How to use HTTP in laravel to make requests

In this article let’s understand how to use HTTP in laravel to make requests. Please note that this is only available for laravel 7.X versions. Its not available for previous versions. So, laravel introduced this quick and easy to use api to make requests from any other third party. It provides various types of request …

PHP implode and explode function with example

PHP implode and explode function with example

In this article lets understand how to use PHP implode and explode function with example here. Implode and explode functions are used for the purpose like creating array from string and/or creating string from array. Let us understand it step by step with it’s definitions, parameters and examples. 1.  explode() function Syntax : Return Type: …

Laravel whereBetween, whereNotBetween eloquent query example

Laravel whereBetween, whereNotBetween eloquent query example

In this article lets understand Laravel whereBetween, whereNotBetween eloquent query with example. We will also look at the  whereBetweenColumns, whereNotBetweenColumns here. 1.  whereBetween query Laravel syntax : Plain syntax: select * from `users` where `rating` between 1 and 4; The whereBetween method verifies that a column’s value is between two values. Here we are fetching user rating …

Laravel whereIn, whereNotIn eloquent query example

Laravel whereIn, whereNotIn eloquent query example

In this article lets understand Laravel whereIn, whereNotIn eloquent query with example. We will also look at the  orWhereIn , orWhereNotIn here. 1.  whereIn query Laravel syntax : Plain syntax: Select * from users where id in (1,2,3,4); Basically it is very easy from syntax to understand but whereIn method verifies that a given column’s value is …