Symfony/Doctrine Randomly Deleting Data
I'm very new to symfony/doctrine so I'm probably doing something stupid. Sometimes (seemingly at random) data just disappears from my mysql database. Does anyone have any idea what might be happening?
Maybe I'm using the entity manager interface incorrectly? Most of the time everything works fine.
https://redd.it/1kw2ytg
@r_php
I'm very new to symfony/doctrine so I'm probably doing something stupid. Sometimes (seemingly at random) data just disappears from my mysql database. Does anyone have any idea what might be happening?
Maybe I'm using the entity manager interface incorrectly? Most of the time everything works fine.
https://redd.it/1kw2ytg
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
Optimizing MySQL queries in Symfony apps
Hi Symfony developers,
Vlad Mihalcea shared some interesting findings after running the Spring PetClinic app under load and analyzing query performance.
The tool he used flagged high-latency queries, suggested index changes, helped reduce resource usage and improve query performance.
Link if you want to skim: https://vladmihalcea.com/mysql-query-optimization-releem/
Just curious - anyone here use tools for automatic identification and optimization of inefficient SQL queries in your workflow?
https://redd.it/1kw4wwb
@r_php
Hi Symfony developers,
Vlad Mihalcea shared some interesting findings after running the Spring PetClinic app under load and analyzing query performance.
The tool he used flagged high-latency queries, suggested index changes, helped reduce resource usage and improve query performance.
Link if you want to skim: https://vladmihalcea.com/mysql-query-optimization-releem/
Just curious - anyone here use tools for automatic identification and optimization of inefficient SQL queries in your workflow?
https://redd.it/1kw4wwb
@r_php
Vlad Mihalcea
MySQL Query Optimization with Releem - Vlad Mihalcea
If you are using MySQL and want to benefit from automatic query optimization, then Releem can help you achieve this goal.
Made something cool, HTML5 truncation library called chophper
Built this a while back and we use it in some WordPress plugins at scale. It has handled all the dynamic content thrown at it in the wild world of WP, felt like it might be useful to others as well as a general PHP tool.
Feel free to trash it if its dumb, but it only has 1 dependency, and no real PHP minimum requirements like others did.
https://github.com/code-atlantic/chophper
Truncate chars, optionally respecting word boundaries
Truncate words, optionally respecting sentence boundaries
Truncate sentences, optionally respecting block boundaries
Truncate blocks (paragraphs, lists, etc.)
Preserving HTML tags
Preserving HTML entities
​
// Full is built to fully support HTML5 without breaking the HTML structure.
use Chophper\Full as Chophper;
$options
// ... see options below.
;
Chophper::truncate($html, $length, $options);
https://redd.it/1kw5s4g
@r_php
Built this a while back and we use it in some WordPress plugins at scale. It has handled all the dynamic content thrown at it in the wild world of WP, felt like it might be useful to others as well as a general PHP tool.
Feel free to trash it if its dumb, but it only has 1 dependency, and no real PHP minimum requirements like others did.
https://github.com/code-atlantic/chophper
Truncate chars, optionally respecting word boundaries
Truncate words, optionally respecting sentence boundaries
Truncate sentences, optionally respecting block boundaries
Truncate blocks (paragraphs, lists, etc.)
Preserving HTML tags
Preserving HTML entities
​
// Full is built to fully support HTML5 without breaking the HTML structure.
use Chophper\Full as Chophper;
$options
// ... see options below.
;
Chophper::truncate($html, $length, $options);
https://redd.it/1kw5s4g
@r_php
GitHub
GitHub - code-atlantic/chophper: PHP utility to handle text truncation within HTML while maintaining full tag structure. Truncate…
PHP utility to handle text truncation within HTML while maintaining full tag structure. Truncate by chars, words, sentences or paragraphs. Optionally finish on whole words/sentences. - code-atlanti...
New in Symfony 7.3: Validator Improvements
https://symfony.com/blog/new-in-symfony-7-3-validator-improvements?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1kwhozj
@r_php
https://symfony.com/blog/new-in-symfony-7-3-validator-improvements?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1kwhozj
@r_php
Symfony
New in Symfony 7.3: Validator Improvements (Symfony Blog)
Symfony 7.3 introduces validation improvements including better When constraint, deprecations for array-based options, and enhanced file, image, and uniqueness constraints.
PHPVerse 2025 afterparty 🎉 (Amsterdam)
Hey folks,
If you’re in or near Amsterdam, NL, mark your calendar for Tuesday, June 17!
Right after the PHPVerse 2025 conference, we’re hosting a special edition of the AmsterdamPHP meetup, featuring some of the speakers from the event, including:
Nils Adermann (Co-founder, Packagist)
Nicolas Grekas (Core Developer, Symfony) …and more to be announced.
We’ll have a short talk, a panel discussion on the past and future of PHP, and plenty of time to chat over 🍕 pizza.
📍 Location: Café Restaurant Dauphine, Amsterdam
🕒 Time: Doors open 18:30, talks start 19:30
🎟️ Free event – open to everyone
RSVP here:
👉 https://www.meetup.com/amsterdamphp/events/307306474/
If you’re around for the conference, or just in town and into PHP, come hang out. And feel free to share the link with anyone who might be interested.
We're all very much looking forward to meeting other people in the PHP community :)
Hope to see some of you there!
https://redd.it/1kwjmro
@r_php
Hey folks,
If you’re in or near Amsterdam, NL, mark your calendar for Tuesday, June 17!
Right after the PHPVerse 2025 conference, we’re hosting a special edition of the AmsterdamPHP meetup, featuring some of the speakers from the event, including:
Nils Adermann (Co-founder, Packagist)
Nicolas Grekas (Core Developer, Symfony) …and more to be announced.
We’ll have a short talk, a panel discussion on the past and future of PHP, and plenty of time to chat over 🍕 pizza.
📍 Location: Café Restaurant Dauphine, Amsterdam
🕒 Time: Doors open 18:30, talks start 19:30
🎟️ Free event – open to everyone
RSVP here:
👉 https://www.meetup.com/amsterdamphp/events/307306474/
If you’re around for the conference, or just in town and into PHP, come hang out. And feel free to share the link with anyone who might be interested.
We're all very much looking forward to meeting other people in the PHP community :)
Hope to see some of you there!
https://redd.it/1kwjmro
@r_php
Meetup
AmsterdamPHP Special PHPVerse Edition, di 17 jun 2025, 18:30 | Meetup
**🎉 Special AmsterdamPHP Meetup – June 17th, 2025**
Right after **[PHPVerse 2025](https://lp.jetbrains.com/phpverse-2025/)**, we’re keeping the momentum going with a **sp
Right after **[PHPVerse 2025](https://lp.jetbrains.com/phpverse-2025/)**, we’re keeping the momentum going with a **sp
LarAgent v0.4 is here — Gemini, Streaming, Fallbacks & More! 🚀
https://blog.laragent.ai/laragent-v0-4-is-here-gemini-streaming-fallbacks-more/
https://redd.it/1kwmhzh
@r_php
https://blog.laragent.ai/laragent-v0-4-is-here-gemini-streaming-fallbacks-more/
https://redd.it/1kwmhzh
@r_php
LarAgent
LarAgent v0.4 is here — Gemini, Streaming, Fallbacks & More! 🚀
We’re excited to announce the release of LarAgent v0.4.0, bringing major upgrades that make your Laravel-based AI agents faster, smarter, and more resilient.
Let’s break down what’s new 👇
🔹 Gemini Driver Support
Now you can use Google’s Gemini API alongside…
Let’s break down what’s new 👇
🔹 Gemini Driver Support
Now you can use Google’s Gemini API alongside…
LarAgent v0.4 is here — Gemini, Streaming, Fallbacks & More! 🚀
https://blog.laragent.ai/laragent-v0-4-is-here-gemini-streaming-fallbacks-more/
https://redd.it/1kwmq9e
@r_php
https://blog.laragent.ai/laragent-v0-4-is-here-gemini-streaming-fallbacks-more/
https://redd.it/1kwmq9e
@r_php
LarAgent
LarAgent v0.4 is here — Gemini, Streaming, Fallbacks & More! 🚀
We’re excited to announce the release of LarAgent v0.4.0, bringing major upgrades that make your Laravel-based AI agents faster, smarter, and more resilient.
Let’s break down what’s new 👇
🔹 Gemini Driver Support
Now you can use Google’s Gemini API alongside…
Let’s break down what’s new 👇
🔹 Gemini Driver Support
Now you can use Google’s Gemini API alongside…
I built Laravel AI Factory a package for generating realistic test data using AI models
Hello guys, I've had this thought that it would be quite cool to be able to create test data using AI, instead of plain Faker which Laravel provides. So I created a package for this called laravel-ai-factory, you can check it out on https://github.com/fdomgjoni99/laravel-ai-factory .
I’d love to hear your thoughts and what you think should be added next!
https://redd.it/1kwspwo
@r_php
Hello guys, I've had this thought that it would be quite cool to be able to create test data using AI, instead of plain Faker which Laravel provides. So I created a package for this called laravel-ai-factory, you can check it out on https://github.com/fdomgjoni99/laravel-ai-factory .
I’d love to hear your thoughts and what you think should be added next!
https://redd.it/1kwspwo
@r_php
GitHub
GitHub - fdomgjoni99/laravel-ai-factory: Laravel AI Factory is a developer-friendly package for generating realistic test data…
Laravel AI Factory is a developer-friendly package for generating realistic test data using AI models. It integrates seamlessly with Laravel factories and supports both AI-generated and manually de...
Introducing ‘godump’ – a Symfony/Laravel Inspired Pretty-Printer for Go Structs and Values.
https://redd.it/1kwvcgv
@r_php
https://redd.it/1kwvcgv
@r_php
Reddit
From the laravel community on Reddit: Introducing ‘godump’ – a Symfony/Laravel Inspired Pretty-Printer for Go Structs and Values.
Explore this post and more from the laravel community
What the best strategy to handle multiple possible different exceptions?
Considering a scenario in which we need to perform several relative operations on a service, what is the best alternative to manage multiple exceptions, returning to the user the specific step in which the problem occurred?
<?php
namespace App\Services\Auth;
use App\DTOs\Auth\RegisterDTO;
use App\Models\User;
use RuntimeException;
use Throwable;
class RegisterService
{
/**
* u/throws Throwable
*/
public function execute(RegisterDTO $registerDTO)
{
try {
/*
* Operation X: First exception possibility
* Consider a database insert for user, can throw a db error
*/
/*
* Operation Y: Second exception possibility
* Now, we need to generate a token to user verify account,
* for this, we save token in db, can throw another db error, but in different step
*/
/*
* Operation Z: Third exception possibility
* Another operation with another exception
*/
} catch (Throwable $e) {
}
// OR another method, works, but it is extremelly verbose
try {
/*
* Operation X: First exception possibility
*/
} catch (Throwable $e) {
}
try {
/*
* Operation X: Second exception possibility
*/
} catch (Throwable $e) {
}
}
}
https://redd.it/1kx07me
@r_php
Considering a scenario in which we need to perform several relative operations on a service, what is the best alternative to manage multiple exceptions, returning to the user the specific step in which the problem occurred?
<?php
namespace App\Services\Auth;
use App\DTOs\Auth\RegisterDTO;
use App\Models\User;
use RuntimeException;
use Throwable;
class RegisterService
{
/**
* u/throws Throwable
*/
public function execute(RegisterDTO $registerDTO)
{
try {
/*
* Operation X: First exception possibility
* Consider a database insert for user, can throw a db error
*/
/*
* Operation Y: Second exception possibility
* Now, we need to generate a token to user verify account,
* for this, we save token in db, can throw another db error, but in different step
*/
/*
* Operation Z: Third exception possibility
* Another operation with another exception
*/
} catch (Throwable $e) {
}
// OR another method, works, but it is extremelly verbose
try {
/*
* Operation X: First exception possibility
*/
} catch (Throwable $e) {
}
try {
/*
* Operation X: Second exception possibility
*/
} catch (Throwable $e) {
}
}
}
https://redd.it/1kx07me
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Kinda like Time, but this time, with distance
I’ve just released yet another distance library but using the same tricks I’ve learned from my Time Library. So you can be sure that 100 centimeters is triple-equal to 1 meter. You also have some type-safety so that you aren’t relying on bare ints/floats for distance, and then someone puts in centimeters instead of meters.
This also has some (de)serialization support for Crell's Serde library, for when you want to serialize a distance to a specific number in a certain unit.
Note: this uses micrometers as the base unit; that means 64-bit systems are limited to around the size of the solar system, while 32-bit systems are limited to a couple of meters.
https://redd.it/1kx0q42
@r_php
I’ve just released yet another distance library but using the same tricks I’ve learned from my Time Library. So you can be sure that 100 centimeters is triple-equal to 1 meter. You also have some type-safety so that you aren’t relying on bare ints/floats for distance, and then someone puts in centimeters instead of meters.
This also has some (de)serialization support for Crell's Serde library, for when you want to serialize a distance to a specific number in a certain unit.
Note: this uses micrometers as the base unit; that means 64-bit systems are limited to around the size of the solar system, while 32-bit systems are limited to a couple of meters.
https://redd.it/1kx0q42
@r_php
packagist.org
withinboredom/distance - Packagist
typesafe distance
I just published the first draft of my course on building high-performance PHP apps with Swoole
Hi everyone!
I've been working on this course to teach how to build high-performance, coroutine-based apps in PHP using Swoole. It covers architecture, async patterns, real-time APIs, and a full example project called Paw Salon.
This is the first release draft. It’s not polished, but it’s complete enough to show the ideas, and I’d love feedback from other PHP devs. Ah, it will be available for free until I finish it.
If you’re curious about Swoole and async programming with PHP, DM me and I'll send you the download link.
Thanks!
https://redd.it/1kx26ik
@r_php
Hi everyone!
I've been working on this course to teach how to build high-performance, coroutine-based apps in PHP using Swoole. It covers architecture, async patterns, real-time APIs, and a full example project called Paw Salon.
This is the first release draft. It’s not polished, but it’s complete enough to show the ideas, and I’d love feedback from other PHP devs. Ah, it will be available for free until I finish it.
If you’re curious about Swoole and async programming with PHP, DM me and I'll send you the download link.
Thanks!
https://redd.it/1kx26ik
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Pipe Operator RFC passed
Voting is closed for the pipe operator.
This (taken directly from the RFC) will be legal code in 8.5:
https://redd.it/1kx872h
@r_php
Voting is closed for the pipe operator.
This (taken directly from the RFC) will be legal code in 8.5:
$result = "Hello World"
|> htmlentities(...)
|> str_split(...)
|> fn($x) => array_map(strtoupper(...), $x)
|> fn($x) => array_filter($x, fn($v) => $v != 'O');
https://redd.it/1kx872h
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
New in Symfony 7.3: DX Improvements (part 1)
https://symfony.com/blog/new-in-symfony-7-3-dx-improvements-part-1?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1kxbhfc
@r_php
https://symfony.com/blog/new-in-symfony-7-3-dx-improvements-part-1?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1kxbhfc
@r_php
Symfony
New in Symfony 7.3: DX Improvements (part 1) (Symfony Blog)
Symfony 7.3 brings DX improvements like full Twig deprecation reporting, PascalCase string support, new form helpers, union types in OptionsResolver and a DatePoint Doctrine Type.
NODEJS CAN RUN PHP !!!
based from the tweet of matteo collina : https://x.com/matteocollina/status/1927395639698096313
i was wondering if it's only like for dummy noscripts or is it legitimately a thing???
https://redd.it/1kxcpgz
@r_php
based from the tweet of matteo collina : https://x.com/matteocollina/status/1927395639698096313
i was wondering if it's only like for dummy noscripts or is it legitimately a thing???
https://redd.it/1kxcpgz
@r_php
Reddit
From the PHP community on Reddit: NODEJS CAN RUN PHP !!!
Explore this post and more from the PHP community
How I can make/configure make:command to place my comands into a specific directory instead of the default one?
If I need a command I type:
In order to make a command upon
https://redd.it/1kxghve
@r_php
If I need a command I type:
php bin/console make:command mycommand:dosmething
In order to make a command upon
./src/Console but a coleague of mine does a refactor ans places the commands upon ./src/Infrastructure/Console instead of the default path. Is there a way to override the make:command in order to place the generated commands upon the desired path?https://redd.it/1kxghve
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
Built a full WebRTC implementation in PHP – Feedback welcome!
Hey everyone!
I've been working on a full WebRTC implementation in PHP and just released a set of packages that handle everything from ICE, DTLS, SCTP, RTP, and SRTP to signaling and statistics.
It’s built entirely in PHP (no Node.js or JavaScript required on the backend), using PHP FFI to interface with native libraries like OpenSSL and VPX when needed. The goal is to make it easy to build WebRTC-based apps in pure PHP – including media servers, video conference web app, SFUs, and peer-to-peer apps.
GitHub: https://github.com/PHP-WebRTC
Features:
Full WebRTC stack: ICE, DTLS, SRTP, SCTP, RTP
Adapter-based signaling (WebSocket, TCP, UDP, etc.)
PHP-native SDP and stats
SFU-ready architecture
Fully asynchronous with ReactPHP
I'm actively looking for:
Feedback on architecture or API design
Suggestions for real-world use cases
Contributions, issues, or ideas from the community
If you're interested in media streaming or real-time communication with PHP, I'd love your thoughts. Also happy to answer any technical questions!
Thanks 🙏
https://redd.it/1kxnjod
@r_php
Hey everyone!
I've been working on a full WebRTC implementation in PHP and just released a set of packages that handle everything from ICE, DTLS, SCTP, RTP, and SRTP to signaling and statistics.
It’s built entirely in PHP (no Node.js or JavaScript required on the backend), using PHP FFI to interface with native libraries like OpenSSL and VPX when needed. The goal is to make it easy to build WebRTC-based apps in pure PHP – including media servers, video conference web app, SFUs, and peer-to-peer apps.
GitHub: https://github.com/PHP-WebRTC
Features:
Full WebRTC stack: ICE, DTLS, SRTP, SCTP, RTP
Adapter-based signaling (WebSocket, TCP, UDP, etc.)
PHP-native SDP and stats
SFU-ready architecture
Fully asynchronous with ReactPHP
I'm actively looking for:
Feedback on architecture or API design
Suggestions for real-world use cases
Contributions, issues, or ideas from the community
If you're interested in media streaming or real-time communication with PHP, I'd love your thoughts. Also happy to answer any technical questions!
Thanks 🙏
https://redd.it/1kxnjod
@r_php
GitHub
PHP WebRTC
A pure PHP implementation of WebRTC. PHP WebRTC has 26 repositories available. Follow their code on GitHub.