Why is using DTOs such a pain?
I’ve been trying to add proper DTOs into a Laravel project, but it feels unnecessarily complicated. Looked at Spatie’s Data package, great idea, but way too heavy for simple use cases. Lots of boilerplate and magic that I don’t really need.
There's nested DTOs, some libraries handle
validation, and its like they try to do more stuff than necessary. Associative arrays seem like I'm gonna break something at some point.
Anyone here using a lightweight approach for DTOs in Laravel? Do you just roll your own PHP classes, use value objects, or rely on something simpler than Spatie’s package?
https://redd.it/1oe6gda
@r_php
I’ve been trying to add proper DTOs into a Laravel project, but it feels unnecessarily complicated. Looked at Spatie’s Data package, great idea, but way too heavy for simple use cases. Lots of boilerplate and magic that I don’t really need.
There's nested DTOs, some libraries handle
validation, and its like they try to do more stuff than necessary. Associative arrays seem like I'm gonna break something at some point.
Anyone here using a lightweight approach for DTOs in Laravel? Do you just roll your own PHP classes, use value objects, or rely on something simpler than Spatie’s package?
https://redd.it/1oe6gda
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
My production architecture for Laravel build with Docker compose, Traefik and FrankenPhp
Hi, everyone, for my little product, coz.jp I completed an architecture that I'm proud of. Using the tech mentioned in the noscript I managed to prepare a stable, fast and easy to maintain infrastructure.
Here the full article with the files templates too. if you have any questions or more importantly suggesitons feel free to ask me here or on the linked article: https://coz.jp/TGzzQa
https://redd.it/1oe2q1b
@r_php
Hi, everyone, for my little product, coz.jp I completed an architecture that I'm proud of. Using the tech mentioned in the noscript I managed to prepare a stable, fast and easy to maintain infrastructure.
Here the full article with the files templates too. if you have any questions or more importantly suggesitons feel free to ask me here or on the linked article: https://coz.jp/TGzzQa
https://redd.it/1oe2q1b
@r_php
coz.jp
Fast URL Shortener | Coz.jp
Shorten URLs, track analytics, and manage links with ease. Get started now!
What is the difference between a bus and a transport
In my project I have these settings:
As you can see I have the follwoing transports:
async
failed
sql_channel_manager_dlq
sqschannelmanager
And the following buses:
event.bus
command.bus
But I have trouble inderstanding the difference between buses and transports.
My google-fu leads me only to generic info regarding on how to setup the queue listener: https://symfony.com/doc/current/messenger.html
But I fail to comperhend the difference between bus and transport. What is the difference between these 2?
So far I understood that a bus is some sort of road that transport uses it to handle a message, if it is true in my example how I can define that all messages passed through
https://redd.it/1oe3ocx
@r_php
In my project I have these settings:
framework:
messenger:
transports:
async: '%env(MESSENGER_TRANSPORT_DSN)%'
failed: 'doctrine://default?table_name=failed_messages'
sql_channel_manager_dlq:
dsn: '%env(SQS_CHANNEL_MANAGER_TRANSPORT_DLQ_DSN)%'
options:
access_key: '%env(AWS_ACCESS_KEY_ID)%'
secret_key: '%env(AWS_SECRET_ACCESS_KEY)%'
region: '%env(AWS_REGION)%'
queue_name: '%env(CHANNEL_MANAGER_QUEUE_NAME_DLQ)%'
sqs_channel_manager:
failure_transport: sql_channel_manager_dlq
dsn: '%env(SQS_CHANNEL_MANAGER_TRANSPORT_DSN)%'
serializer: App\Infrastructure\Messenger\ChannelManagerSerializer
options:
access_key: '%env(AWS_ACCESS_KEY_ID)%'
secret_key: '%env(AWS_SECRET_ACCESS_KEY)%'
region: '%env(AWS_REGION)%'
queue_name: '%env(CHANNEL_MANAGER_QUEUE_NAME)%'
failure_transport: failed
default_bus: command.bus
buses:
event.bus: ~
command.bus:
middleware:
- 'App\Infrastructure\Middleware\RequestIdMiddleware'
routing:
App\Message\TestQueue: async
App\Domain\Event\ChannelManager\ChannelManagerEventHasReceived: sqs_channel_manager
As you can see I have the follwoing transports:
async
failed
sql_channel_manager_dlq
sqschannelmanager
And the following buses:
event.bus
command.bus
But I have trouble inderstanding the difference between buses and transports.
My google-fu leads me only to generic info regarding on how to setup the queue listener: https://symfony.com/doc/current/messenger.html
But I fail to comperhend the difference between bus and transport. What is the difference between these 2?
So far I understood that a bus is some sort of road that transport uses it to handle a message, if it is true in my example how I can define that all messages passed through
sqs_channel_manager would be handled upon event.bus?https://redd.it/1oe3ocx
@r_php
Symfony
Messenger: Sync & Queued Message Handling (Symfony Docs)
Messenger provides a message bus with the ability to send messages and then handle them immediately in your application or send them through transports (e.g. queues) to be handled later. To learn more…
Introducing Nimbus: An integrated, in-browser API client for Laravel with a touch of magic
https://redd.it/1odpprx
@r_php
https://redd.it/1odpprx
@r_php
Nyno (open-source n8n alternative using YAML) now supports PHP functions for high performing Workflow commands.
https://github.com/empowerd-cms/nyno
https://redd.it/1oeg5iq
@r_php
https://github.com/empowerd-cms/nyno
https://redd.it/1oeg5iq
@r_php
GitHub
GitHub - empowerd-cms/nyno: Create and Run Linux Workflows without Limits. Short for "nine" / "yaml" / "no-code" / "automation".
Create and Run Linux Workflows without Limits. Short for "nine" / "yaml" / "no-code" / "automation". - GitHub - empowerd-cms...
SymfonyCon Amsterdam 2025: How native lazy objects will change Doctrine and Symfony forever
https://symfony.com/blog/symfonycon-amsterdam-2025-how-native-lazy-objects-will-change-doctrine-and-symfony-forever?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1ody6bp
@r_php
https://symfony.com/blog/symfonycon-amsterdam-2025-how-native-lazy-objects-will-change-doctrine-and-symfony-forever?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1ody6bp
@r_php
Symfony
SymfonyCon Amsterdam 2025: How native lazy objects will change Doctrine and Symfony forever (Symfony Blog)
⚡ Native lazy loading in PHP 8.4. Discover with Benjamin Eberlei how PHP 8.4’s built-in lazy objects and proxies will transform Doctrine and Symfony
Designing A 2D Game Engine for PHP (Using Swift)
https://youtu.be/ErYDVGER1Rg
https://redd.it/1odvk87
@r_php
https://youtu.be/ErYDVGER1Rg
https://redd.it/1odvk87
@r_php
YouTube
2D Swift Game Engine Designed For PHP - Phorst
Github soon.... Game engine developed in Swift for Windows, Linux, MacOS.
NativePHP Mobile: What's your dev workflow? Do you rebuild every time?
I'm working with NativePHP for mobile and I'm struggling to figure out an efficient development workflow.
I did my first build and deployed it to my phone, but rebuilding the entire app every time I want to see changes is painfully slow. I've searched online but couldn't find any documentation or discussions about mobile development workflows with NativePHP.
Do you rebuild the full app for every change, or is there a way to get live/hot reload working?
https://redd.it/1oejwmv
@r_php
I'm working with NativePHP for mobile and I'm struggling to figure out an efficient development workflow.
I did my first build and deployed it to my phone, but rebuilding the entire app every time I want to see changes is painfully slow. I've searched online but couldn't find any documentation or discussions about mobile development workflows with NativePHP.
Do you rebuild the full app for every change, or is there a way to get live/hot reload working?
https://redd.it/1oejwmv
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
NativePHP going truly native.. for real-real!
https://www.youtube.com/watch?v=yY9fHxvFOdk
https://redd.it/1od4yf4
@r_php
https://www.youtube.com/watch?v=yY9fHxvFOdk
https://redd.it/1od4yf4
@r_php
YouTube
NativePHP for Mobile v2 - REAL. NATIVE. PHP.
This is it.
No wrappers. No gimmicks.
NativePHP for Mobile v2 is the real deal — running Laravel directly on device, with native UI components like side navs, bottom tabs, and floating action buttons.
This video isn’t a commercial. It’s a glimpse at the…
No wrappers. No gimmicks.
NativePHP for Mobile v2 is the real deal — running Laravel directly on device, with native UI components like side navs, bottom tabs, and floating action buttons.
This video isn’t a commercial. It’s a glimpse at the…
After my huge success replacing Laravel and any other frameworks… here’s my PHP Router made with Attributes
https://github.com/interaapps/deverm-router
https://redd.it/1odita2
@r_php
https://github.com/interaapps/deverm-router
https://redd.it/1odita2
@r_php
GitHub
GitHub - interaapps/deverm-router: Deverm-php-Router is an open-source PHP page-router.
Deverm-php-Router is an open-source PHP page-router. - interaapps/deverm-router
New in Symfony 7.4: Caching HTTP Client
https://symfony.com/blog/new-in-symfony-7-4-caching-http-client?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1od30oz
@r_php
https://symfony.com/blog/new-in-symfony-7-4-caching-http-client?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1od30oz
@r_php
Symfony
New in Symfony 7.4: Caching HTTP Client (Symfony Blog)
Symfony 7.4 introduces RFC 9111-compliant client-side HTTP caching powered by the Cache component.
New in Symfony 7.4: Video Constraint
https://symfony.com/blog/new-in-symfony-7-4-video-constraint?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1oesmju
@r_php
https://symfony.com/blog/new-in-symfony-7-4-video-constraint?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1oesmju
@r_php
Symfony
New in Symfony 7.4: Video Constraint (Symfony Blog)
Symfony 7.4 introduces a new constraint to validate video files with options to control dimensions, codecs, and formats.
I need PHP courses, but the most advanced...
I want to improve as a PHP developer, and I'd like more courses. However, I'd appreciate recommendations for classes, instructors, courses, and platforms.
Thank you in advance.
https://redd.it/1oewa9x
@r_php
I want to improve as a PHP developer, and I'd like more courses. However, I'd appreciate recommendations for classes, instructors, courses, and platforms.
Thank you in advance.
https://redd.it/1oewa9x
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
PHP in 2025 is so good..
https://youtu.be/PLkLhIwVfMk?si=_uOT_LoIJo4vYlE7
https://redd.it/1oexlcs
@r_php
https://youtu.be/PLkLhIwVfMk?si=_uOT_LoIJo4vYlE7
https://redd.it/1oexlcs
@r_php
YouTube
PHP in 2025 is so good..
❤️ sponsor this channel: https://nunomaduro.com/sponsorships 🙌🏻 this video was made possible by:
💎 laracasts / the best way to learn laravel and php: https://pplup.com/@nunomaduro/laracasts
🐰 coderabbit / ai code reviews with instant feedback on pull requests:…
💎 laracasts / the best way to learn laravel and php: https://pplup.com/@nunomaduro/laracasts
🐰 coderabbit / ai code reviews with instant feedback on pull requests:…
Minio Moving to Source-Only, No Docker Images
https://github.com/minio/minio/issues/21647
Seems like kind of a scuzzy move for users. I know Laravel uses Minio docker images for Sail under the hood for local S3 development. I am curious what the outcome will be.
https://redd.it/1od75f3
@r_php
https://github.com/minio/minio/issues/21647
Seems like kind of a scuzzy move for users. I know Laravel uses Minio docker images for Sail under the hood for local S3 development. I am curious what the outcome will be.
https://redd.it/1od75f3
@r_php
GitHub
Docker release? · Issue #21647 · minio/minio
Hello, I did not find a new image for the security release Security/CVE RELEASE.2025-10-15T17-29-55Z, on quay.io nor DockerHub. Is it expected? If it isn’t, can you please push a new release for th...
Are there Forge provisioning logs somewhere
Provisioning a server is continually failing at the “making final touches” stage. Everything is installed and running on the server, so I don’t know what the issue is.
I also can’t seem to find any forge error logs in my server. I looked in root and in var/log. Not in either place.
Any tips on where I can find out why provisioning fails?
In case this matters, I am bringing a fresh ec2 instance to Forge to provision. I haven’t been able to launch an ec2 directly from forge dashboard in a while, so this is not my first time doing this but it’s my first since the redesign.
https://redd.it/1of2yr8
@r_php
Provisioning a server is continually failing at the “making final touches” stage. Everything is installed and running on the server, so I don’t know what the issue is.
I also can’t seem to find any forge error logs in my server. I looked in root and in var/log. Not in either place.
Any tips on where I can find out why provisioning fails?
In case this matters, I am bringing a fresh ec2 instance to Forge to provision. I haven’t been able to launch an ec2 directly from forge dashboard in a while, so this is not my first time doing this but it’s my first since the redesign.
https://redd.it/1of2yr8
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
Package turns Laravel Container into Shared Dependency by Default
Hello everyone!
Recently, I came across this PR: https://github.com/laravel/framework/pull/51209 on Laravel. I found it quite interesting, so even though it wasn’t merged into the core, I decided to create a package and named it Laravel Singletonize. Laravel Singletonize is a lightweight package that flips the default behavior of Laravel’s service container so that any class resolved without an explicit binding is treated as a singleton. By reusing implicitly resolved services, you avoid forcing the container to repeat costly reflection work on every request—a noticeable win for larger codebases that lean heavily on auto-wiring. This isn't something entirely unfamiliar: it's actually the default behavior of the Symfony framework when resolving dependencies.
Getting started is straightforward: install via Composer and, if you prefer, register the service provider manually—otherwise package discovery takes care of it. The provider merges a simple configuration file and publishes it for you. You can disable the behavior at runtime through config/laravel-singletonize.php, restoring Laravel’s default per-resolution instantiation whenever you need to troubleshoot or benchmark comparisons.
Singletonize is continuously tested against Laravel 10.x, 11.x, and 12.x, and the bundled test harness confirms that unbound classes, nested dependencies, closure bindings, and parameterized resolutions all reuse the first instance as intended. It also checks that forgetting instances forces fresh objects and that toggling the config flag truly disables the optimization, so you can adopt it with confidence.
Feel free to try it out and let me know your thoughts: https://packagist.org/packages/huynt57/laravel-singletonize
https://redd.it/1oden2r
@r_php
Hello everyone!
Recently, I came across this PR: https://github.com/laravel/framework/pull/51209 on Laravel. I found it quite interesting, so even though it wasn’t merged into the core, I decided to create a package and named it Laravel Singletonize. Laravel Singletonize is a lightweight package that flips the default behavior of Laravel’s service container so that any class resolved without an explicit binding is treated as a singleton. By reusing implicitly resolved services, you avoid forcing the container to repeat costly reflection work on every request—a noticeable win for larger codebases that lean heavily on auto-wiring. This isn't something entirely unfamiliar: it's actually the default behavior of the Symfony framework when resolving dependencies.
Getting started is straightforward: install via Composer and, if you prefer, register the service provider manually—otherwise package discovery takes care of it. The provider merges a simple configuration file and publishes it for you. You can disable the behavior at runtime through config/laravel-singletonize.php, restoring Laravel’s default per-resolution instantiation whenever you need to troubleshoot or benchmark comparisons.
Singletonize is continuously tested against Laravel 10.x, 11.x, and 12.x, and the bundled test harness confirms that unbound classes, nested dependencies, closure bindings, and parameterized resolutions all reuse the first instance as intended. It also checks that forgetting instances forces fresh objects and that toggling the config flag truly disables the optimization, so you can adopt it with confidence.
Feel free to try it out and let me know your thoughts: https://packagist.org/packages/huynt57/laravel-singletonize
https://redd.it/1oden2r
@r_php
GitHub
[RFC][11.x] New option - Shared dependencies by default by sarven · Pull Request #51209 · laravel/framework
PR Title:
"Add a new option to the config to change the default behavior of the container"
Denoscription
Currently, there is no possibility to share resolved dependencies without bi...
"Add a new option to the config to change the default behavior of the container"
Denoscription
Currently, there is no possibility to share resolved dependencies without bi...
I created a PoC for a web framework that combines PHP & JS
Hello, I created a small experimental framework called Hybrid JavaScript PHP (HJP).
It connects PHP and JavaScript through a shared Virtual DOM, making PHP apps reactive without big frontend libraries.
Features
PHP renders the initial HTML + Virtual DOM
JavaScript syncs the state changes in real-time
Tiny diffing system for updates
No build tools or dependencies - Just PHP and Vanilla JS
It is still a prototype, but it shows how a VDOM can be combined with PHP so you have bi-directional reactive framework. Check it out at this repository: lukevdbroek-nl/hybrid-javanoscript-php
https://redd.it/1ofaf4i
@r_php
Hello, I created a small experimental framework called Hybrid JavaScript PHP (HJP).
It connects PHP and JavaScript through a shared Virtual DOM, making PHP apps reactive without big frontend libraries.
Features
PHP renders the initial HTML + Virtual DOM
JavaScript syncs the state changes in real-time
Tiny diffing system for updates
No build tools or dependencies - Just PHP and Vanilla JS
It is still a prototype, but it shows how a VDOM can be combined with PHP so you have bi-directional reactive framework. Check it out at this repository: lukevdbroek-nl/hybrid-javanoscript-php
https://redd.it/1ofaf4i
@r_php
GitHub
GitHub - lukevdbroek-nl/hybrid-javanoscript-php: A lightweight reactive framework that bridges PHP and JavaScript through a shared…
A lightweight reactive framework that bridges PHP and JavaScript through a shared Virtual DOM for real-time state synchronization. - lukevdbroek-nl/hybrid-javanoscript-php
PHP Extension Identifier
I created a PHP extension to work with 128 bit Identifiers like UUIDs and ULIDs.
It also contains a Codec inspired in Go's alphabet based encoder.
My dream would be an extension like this should be part of the core, but hey, dreaming is cheap!
Please do take a look and try it! It would be useful for me to know how you find the API and if there are any weird bugs anywhere.
Cheers!
https://redd.it/1ofc9cr
@r_php
I created a PHP extension to work with 128 bit Identifiers like UUIDs and ULIDs.
It also contains a Codec inspired in Go's alphabet based encoder.
My dream would be an extension like this should be part of the core, but hey, dreaming is cheap!
Please do take a look and try it! It would be useful for me to know how you find the API and if there are any weird bugs anywhere.
Cheers!
https://redd.it/1ofc9cr
@r_php
GitHub
GitHub - castor-labs/php-ext-identifier: A high-performance PHP extension for working with 128-bit identifiers including UUIDs…
A high-performance PHP extension for working with 128-bit identifiers including UUIDs and ULIDs - castor-labs/php-ext-identifier
New in PHP 8.5: Small Features, Big Impact
https://chrastecky.dev/programming/new-in-php-8-5-small-features-big-impact
https://redd.it/1ofmjvo
@r_php
https://chrastecky.dev/programming/new-in-php-8-5-small-features-big-impact
https://redd.it/1ofmjvo
@r_php