-
How to Build RESTful API with Laravel 10: A Comprehensive Guide
In this article, I will guide you through building RESTful API in Laravel 10. In this guide, you will create a simple API that handles basic operations on tasks. You will create the database table from scratch, create a corresponding Model, add methods in the Controller and connect them to routes. For the testing purposes,…
-
Top Laravel Interview Questions & Answers For Developers
1. How can you assign Middleware to a specific route? To assign middleware to a specific route, there is a middleware method that can be invoked when the defining the route. It also can accept an array of middleware names. 2. What is Eloquent? Eloquent is an ORM (object-relational mapper) that helps a developer to…
-
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…