In Filament simple resources, you can edit the record in a modal window. Did you know there's a way to show that modal not in the center of the screen, but sliding out from the right side? In this short tutorial, I will show you how.
In Laravel, we have a method called whereHas that takes the parent Model only if it has a relationship matching a condition. But there's also withWhereHas, what does it do?
PHP Traits are a powerful feature that allows you to reuse code in multiple classes without repeating yourself. In this tutorial, I will show 4 examples of how you can use Traits in your Eloquent models.
The performance of our applications is one of the top things we should care about. Inefficient Eloquent or DB queries are probably no.1 reason for bad performance. In this tutorial, I will show you the top 3 mistakes developers make when it comes to Eloquent performance, and how to fix them.
When working with large datasets that are complex to get or rarely change, we can use caching to reduce the load on our database. For this, we will use the Cache class. In the examples, we will try to optimize the database call that takes 10 000 records from it.
While working with models - we often need to do something with the data before/after saving it in the database: change the format, trim whitespaces, trim HTML tags, and so on.
In this tutorial, we will create a simple search from three Models and will use Laravel Collections to combine them into one collection to show results in the front-end.
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.