-
How to Handle URL Generation in Laravel 10?
While building Laravel applications, you will encounter a task in which you’ll need to generate URLs. Laravel has some very useful helpers that can assist you to generate URLs. These helpers can help you build links for the templates and API responses, or to generate a redirect response to another part of the application. Before…
-
15 Useful Laravel Collection Methods You Have to Know
The Laravel framework comes with very powerful wrapper for working with arrays – Collections. If you have worked with Eloquent you must have encountered and used Collections. Collections are a broader term, where Eloquent Collections are the implementation of these broader Collections. The methods that we cover in this article can be used for both…
-
How to handle Collections outside Laravel
One thing when working with Laravel that I have used the most, are the Laravel Collections. They come handy when you need to manipulate and filter arrays. Collections basically are a wrapper for working with arrays of data. Collections provide a lot of powerful and useful methods to manipulate the arrays. You can check them…
-
How to Declare Variables in PHP: Basics & Examples
Usually when programming languages are learned, the first lesson is how to declare a variable. Declaring variables in PHP is very easy. In this article, we will go through the basics of declaring a variable in PHP. Table of Contents But before we start with how to declare a variable in PHP, we need to…
-
What are Constants and How to Define Them in PHP?
Sometimes in our code, we want to define variables with values that cannot be changed or defined during the execution of the script. For that purpose, we can use constants.Bare in mind that constants are case-sensitive and when declaring them are always uppercase. !!! Prior to PHP 8.0.0, when defining constants with define() function, they…
-
What Is The Difference Between ECHO and PRINT in PHP?
By now, if you are working with PHP, I’m sure that you encountered using echo and print. But do you know the differences between them and are there any differences between them? In this article we will take a look at echo and print, compare them and explain its features. Table of Contents In PHP,…