While working on a demo project, I needed to get the geographical coordinates of a real estate object, by its address: street, postcode, city, and country. In this tutorial, I will show you how to use a package called GeocoderLaravel, to achieve this.
When creating API applications, you often don't want to return ALL the data via API, especially sensitive fields like passwords. In this short tutorial, I will show 4 methods to return only the fields which you need.
In Laravel and Eloquent, to avoid N+1 Query problems or to find slow SQL queries, you may use automatic tools. In this short tutorial, I will show you a few of them.
The term "multi-tenancy" has different meanings and implementations in Laravel. In this article, let's take a look at a multi-database approach, using the package stancl/tenancy: I will show you step-by-step, how to make it work.
If you have two tables with a `hasOne` or `hasMany` relationship between them, and you want to query a row that is missing from the second table, you can use `doesntHave()` in Eloquent.
Some Laravel tasks are running in the background and you need to check whether they are finished. But what if you didn't need to constantly check, but rather "listen" for those events to finish? Let's implement exactly this real-time feedback, with Soketi server.
Collections in Laravel are "hidden gems": not everyone is using them. They are especially effective when performing MULTIPLE operations with data - so-called "chains". I've gathered 15 real-life examples from open-source Laravel projects. The goal is not only to show the Collection methods but also the practical scenarios of WHEN to use them.