PHP Symfony Sonata

Tag PHP

Symfony: Queries from OR

When building Doctrine queries, combining `AND` and `OR` conditions can quickly become difficult to structure correctly. This article shows how to use `QueryBuilder` and `orX()` to group alternative conditions while keeping the required filters separate.

Sonata Admin: Installing the Quill Editor

This article shows how to integrate the free Quill WYSIWYG editor with Sonata Admin as an alternative to paid editors. It covers the basic configuration, toolbar customization, image handling and source-code editing, as well as initializing editors dynamically in Sonata forms. The article also addresses a sorting-related issue and shows how to prevent editor interactions from triggering Sonata’s sorting events.

Symfony: Uid in API

Avoid exposing internal entity IDs in your API. In this article, we’ll see how to use UUID v7 with Symfony Uid, from generating and storing UUIDs to documenting them with NelmioApiDoc and querying them with Doctrine.

Symfony: How to Log Exceeded Failed Login Limits

This article shows how to log the moment when Symfony’s failed login limit is exceeded. It explains why the user cannot be retrieved directly in this case and how to obtain the user identifier, while keeping standard failed login attempts working as expected.

Symfony: User Login Logs

This article shows how to log successful logins, failed login attempts, and logouts in Symfony using security events. It explains how to handle edge cases caused by login throttling and expired sessions, and how to configure trusted proxies in Azure so that the logs contain the client’s actual IP address instead of the load balancer’s IP.

Symfony: Limiting the Number of Failed Login Attempts

In this article, I show how to limit failed login attempts in Symfony using the Rate Limiter component. You’ll learn how to block repeated login attempts and configure Redis as a shared cache pool for applications running on multiple Azure instances. The article also covers configuring custom rate limiters for APIs.

Symfony: Checking for Entity Differences in Doctrine 2

In this article, I show how to use Doctrine 2 UnitOfWork to detect changes in an entity. You’ll learn how to retrieve the original entity data and inspect a change set containing both old and new values, as well as how to efficiently check changes for a single entity.

Symfony: Code Quality

Learn how to keep PHP code consistent, clean, and maintainable with a practical code quality setup. This guide presents a configuration using PSR-12, .gitattributes, PHP CS Fixer, and PHPStan to automate code formatting, ensure consistent line endings, and catch potential problems before they reach production.

Symfony: Custom Bundle

Learn how to create a custom Symfony Bundle in newer Symfony versions, where the bundle structure and configuration approach have changed. This guide walks through creating a bundle from scratch, organizing its files, configuring services and autowiring, loading configuration automatically, and installing the bundle with Composer.

Sonata Admin: Path to Media Files in REST

Learn how to include the file path of Sonata Media Bundle files in a Symfony REST API response. This guide shows how to create a custom serializer that uses Sonata Media’s built-in `path` function and adds the media path only for the required serialization group.

« Older posts

© 2026 PHPNotes — Powered by WordPress

Theme by Anders Noren — Up ↑