Here is all articles with back-end tag
PHP enums provide a clean way to represent a fixed set of possible values. When working with a backed enum, each enum case has an associated scalar value, such as a string or integer. A common situation is receiving a value from a database, API request, form, or another external source and needing to retrieve […]
In PHP, you can create a reference to a variable using the & operator. A reference means that two variables point to the same value, so changing one variable can also affect the other. Here is an example of creating reference in PHP. In the code below $b is a reference to $a, means if […]
Laravel provides many useful string helpers through the Illuminate\Support\Str class. One of them is Str::chopStart(), which makes it easy to remove a specific string from the beginning of another string. It is especially useful when working with prefixes such as URL paths, file names, namespaces, or other formatted strings. # What Is Str::chopStart() in Laravel? […]
SQL injection is one of the oldest and most dangerous security vulnerabilities in web applications. If you’re building applications with Laravel, you may wonder: Does Laravel automatically protect against SQL injection, or do I need to implement additional security measures? The short answer is yes Laravel provides strong built-in protection against SQL injection when you […]
Object-oriented programming in PHP gives developers powerful inheritance features. However, not every class is designed to be extended. That’s where the final keyword comes in. A final class explicitly tells PHP that this class cannot be inherited. It protects the class from being extended and helps preserve its intended behavior. When you declare a class […]
#Introduction array_column is one of my favorite functions in PHP. When you are dealing with a multidimensional array and want to extract a specific piece of data from that structure, array_column is extremely helpful. By passing the array and specifying the key name, you can extract the values of that key separately from the original […]
Learn the difference between Laravel to_route() and redirect()->route() and understand when to use each method in modern Laravel applications.