Tag-based cache inside Laravel repositories

Available to Premium members only
  • avatar
  • 83 Views
  • 12 mins read
Preview post image

Working with cache can drastically improve the performance of an application, especially when dealing with data that doesn't change too often. While Laravel provides solid support for caching through multiple drivers, it doesn't offer native support for cache tags. To work around this limitation, we'll integrate Symfony's Cache component, which brings tag support and fits well into the repository pattern we've already established. In this article, we'll build on the existing structure and focus on using cache tags to group and clear related data more efficiently.

Understanding HMAC signatures and how they work

Available to registered members only
  • avatar
  • 242 Views
  • 4 mins read
Preview post image

HMAC, short for Hash-based Message Authentication Code, is a method used to check that a message is both authentic and unmodified. It's a common tool in webhooks, APIs, and any place where secure communication between systems matters. The idea behind HMAC is to use a shared secret key along with a hashing algorithm to create a unique signature for a message. This signature acts like a stamp of trust, if anything changes in the message or if the wrong key is used, the signature won't match.

Getting started with CQRS in PHP

  • avatar
  • 218 Views
  • 5 mins read
Preview post image

CQRS stands for Command Query Responsibility Segregation. It's a pattern that separates how an application reads data from how it writes data. This approach can help structure code more clearly, especially in systems that deal with complex business logic or need to scale certain operations differently.

 Join Our Monthly Newsletter

Get the latest news and popular articles to your inbox every month

We never send SPAM nor unsolicited emails

Organizing Laravel helpers using Composer

  • avatar
  • 964 Views
  • 4 mins read
Preview post image

As a Laravel project grows, it is common to see the same small functions repeated in multiple places such as formatting values, checking routes, or handling basic text transformations. Instead of scattering these across controllers or traits, a more structured approach is to collect them into a dedicated helper file. While Laravel does not include a default setup for this, Composer's autoload configuration makes it straightforward to register a custom helper file. This ensures those functions are always available throughout the application without manual includes.

Repository cache in Laravel

  • avatar
  • 1.3K Views
  • 1 Like
  • 11 mins read
Preview post image

In modern web applications, optimizing data retrieval is crucial to improving performance and user experience. One common practice is caching database queries to reduce redundant calls to the database. While Laravel offers built-in caching features, in some cases, you may want to implement custom repository caching manually to better control your caching mechanism. This article will walk you through implementing repository caching in Laravel 12, explaining the steps involved and how to achieve better performance in your application.

Create Laravel 12 project from scratch

  • avatar
  • 1.3K Views
  • 2 Likes
  • 6 mins read
Preview post image

Laravel is a PHP framework built to make web development cleaner and faster by following the Model-View-Controller (MVC) pattern. Since its first release in 2011, it has grown into one of the most popular choices for PHP developers. Laravel brings powerful tools like expressive routing, simple database migrations, a built-in authentication system, and Blade templating, making it easier to build full-featured applications without getting buried in repetitive code.

Using guard clauses to write cleaner code

  • avatar
  • 424 Views
  • 3 mins read
Preview post image

Guard clauses are a practical way to write cleaner functions by handling the unwanted cases first. Instead of nesting your entire function inside a stack of if conditions, you check for the early exits up front - returning or throwing as needed - and move on. It's a habit that keeps code flatter and easier to read. The structure becomes simpler, and it’s immediately clear what the function does and under what conditions it doesn’t even bother.

Creating a custom maintenance page in Laravel

  • avatar
  • 8.0K Views
  • 1 Like
  • 5 mins read
Preview post image

In Laravel, maintenance mode is a convenient feature that allows developers to display a custom message to visitors while the application is undergoing updates or fixes. It prevents users from encountering unfinished or broken features, giving you the opportunity to make changes without affecting the live experience. By default, Laravel provides a basic maintenance page, but if you want to create a more personalized version, you can easily do so. A well-designed custom page helps to keep users informed and reassured during maintenance.

Getting Started with Git operations and version control

  • avatar
  • 1.9K Views
  • 1 Like
  • 5 mins read
Preview post image

Git is a popular version control system that helps developers track changes in their code, collaborate with others, and manage project history efficiently. Created by Linus Torvalds in 2005, Git has become an essential tool for software development. It allows teams to work on different parts of a project simultaneously without overwriting each other's changes. By using Git, developers can keep their projects organized, track progress, and revert to previous versions when necessary.

Boost Symfony performance with OPCache

  • avatar
  • 1.6K Views
  • 1 Like
  • 9 mins read
Preview post image

Enhancing the performance of Symfony applications brings a smoother and faster user experience. One powerful tool for achieving this is OPCache. OPCache is a PHP extension that stores precompiled script bytecode in memory, which reduces the overhead of parsing and compiling scripts with each request. This results in faster execution and improved overall efficiency.