Please review my new bundle, RICH, for building robust applications in Symfony
I've been using Symfony since 2012, and last year, I needed to build a new application that had both web and REST API components.
I was familiar with hexagonal architecture, domain driven design, CQRS, and event sourcing, but they all seemed overly complicated. I also knew about API Platform, but it seemed like overkill for basic REST APIs. Plus, I needed my application to support standard HTML web views and JSON API responses.
Through a lot of experimentation, I came up with a similar but simpler architecture I've named RICH: Request, Input, Command, Handler.
A request (from anywhere) is mapped onto an input object, once validated, the input object creates a command object, which is passed (either manually or via message queue) to a handler object which performs the actual business logic.
It's nothing groundbreaking, but I believe it's more flexible than the
I've written a lot more in the README and would love your thoughts and feedback.
https://github.com/1tomany/rich-bundle
https://redd.it/1jw1j51
@r_php
I've been using Symfony since 2012, and last year, I needed to build a new application that had both web and REST API components.
I was familiar with hexagonal architecture, domain driven design, CQRS, and event sourcing, but they all seemed overly complicated. I also knew about API Platform, but it seemed like overkill for basic REST APIs. Plus, I needed my application to support standard HTML web views and JSON API responses.
Through a lot of experimentation, I came up with a similar but simpler architecture I've named RICH: Request, Input, Command, Handler.
A request (from anywhere) is mapped onto an input object, once validated, the input object creates a command object, which is passed (either manually or via message queue) to a handler object which performs the actual business logic.
It's nothing groundbreaking, but I believe it's more flexible than the
#[MapRequestPayload] attribute that comes bundled with Symfony, and allows you to build robust applications easily.I've written a lot more in the README and would love your thoughts and feedback.
https://github.com/1tomany/rich-bundle
https://redd.it/1jw1j51
@r_php
GitHub
GitHub - 1tomany/rich-bundle: Symfony bundle that provides easy scaffolding to build RICH applications
Symfony bundle that provides easy scaffolding to build RICH applications - 1tomany/rich-bundle
[Historical PHP] Sep 2012: PHP 5, pre-composer, with DTOs, zero-depencency livestream timelapse, US corp income tax calculator
https://youtu.be/uCQYmNoICmg
https://redd.it/1jwj63c
@r_php
https://youtu.be/uCQYmNoICmg
https://redd.it/1jwj63c
@r_php
YouTube
PHP Coding: Fed Corp Income Tax Calculator [time lapse]
PHPU Lesson 5: Time-lapsed single 4 hour coding session that took place on Sep 1, 2012.
Demo URL: http://www.phpu.cc/repo/phpu-training/5.tax-calc/?debug=1
Source code: http://bazaar.launchpad.net/~theodore-phpexperts/phpu-training/trunk/view/head:/5.tax…
Demo URL: http://www.phpu.cc/repo/phpu-training/5.tax-calc/?debug=1
Source code: http://bazaar.launchpad.net/~theodore-phpexperts/phpu-training/trunk/view/head:/5.tax…
Symfony Mailer and Mailgun
Hello we are switching from SMTP to API for our mailer and mailgun.
Since SMTP is getting blocked by digitalocean.
https://preview.redd.it/dtveu9llx6ue1.png?width=1148&format=png&auto=webp&s=29a2addf94902156d0dcd2b87abdc4de9c2aa1ad
I am trying to establish connection but i always get errors.
We made Api key and domain Sending key ( api key ) we tested both but we cannot receive connection.
Any help is appreciated
MAILER_DSN=mailgun+api://api:8e459c1***************-******-*******@default?domain=example.eu
https://redd.it/1jwni3b
@r_php
Hello we are switching from SMTP to API for our mailer and mailgun.
Since SMTP is getting blocked by digitalocean.
https://preview.redd.it/dtveu9llx6ue1.png?width=1148&format=png&auto=webp&s=29a2addf94902156d0dcd2b87abdc4de9c2aa1ad
I am trying to establish connection but i always get errors.
We made Api key and domain Sending key ( api key ) we tested both but we cannot receive connection.
Any help is appreciated
MAILER_DSN=mailgun+api://api:8e459c1***************-******-*******@default?domain=example.eu
https://redd.it/1jwni3b
@r_php
Http Requests
Javanoscript / Node
fetch(file)
.then(x => x.text())
.then(y => myDisplay(y));
source: https://www.w3schools.com/js/js\_api\_fetch.asp
\------------------------
Python
import requests
x = requests.get('https://w3schools.com/python/demopage.htm')
source: https://www.w3schools.com/python/module\_requests.asp
\------------------------
PHP (w3school not available)
<?php
$ch = curlinit("http://www.example.com/");
$fp = fopen("examplehomepage.txt", "w");
curlsetopt($ch, CURLOPTFILE, $fp);
curlsetopt($ch, CURLOPTHEADER, 0);
curlexec($ch);
if(curlerror($ch)) {
fwrite($fp, curlerror($ch));
}
curlclose($ch);
fclose($fp);
Source: https://www.php.net/manual/en/curl.examples-basic.php
\------------------------------------------------
Unfortunately I can't make this into a meme for higher popularity, but decided to post anyway in case it sparks any community conversation. I really appreciate all of the improvements PHP has had between 7.0 up to 8.3 and I find it extremely dishonest when people want to talk shit about PHP when all they know is PHP from 2010 before Composer even existed. However, I've seen internals discussion around this subject and its often brushed off as "let userland do it".
I'm working on enhancements of PHP hosted on AWS Lambda and we can't install or assume Guzzle (or any HTTP library) is available. We have to rely on vanilla PHP and the complexity of trying to make a simple POST request using PHP is something that is intimidating for me with 15 years of experience working with PHP, imagine a newcomer that sees a comparison like this? How would they ever choose a PHP career over something else?
Thanks for listening to my rant.
https://redd.it/1jwogce
@r_php
Javanoscript / Node
fetch(file)
.then(x => x.text())
.then(y => myDisplay(y));
source: https://www.w3schools.com/js/js\_api\_fetch.asp
\------------------------
Python
import requests
x = requests.get('https://w3schools.com/python/demopage.htm')
source: https://www.w3schools.com/python/module\_requests.asp
\------------------------
PHP (w3school not available)
<?php
$ch = curlinit("http://www.example.com/");
$fp = fopen("examplehomepage.txt", "w");
curlsetopt($ch, CURLOPTFILE, $fp);
curlsetopt($ch, CURLOPTHEADER, 0);
curlexec($ch);
if(curlerror($ch)) {
fwrite($fp, curlerror($ch));
}
curlclose($ch);
fclose($fp);
Source: https://www.php.net/manual/en/curl.examples-basic.php
\------------------------------------------------
Unfortunately I can't make this into a meme for higher popularity, but decided to post anyway in case it sparks any community conversation. I really appreciate all of the improvements PHP has had between 7.0 up to 8.3 and I find it extremely dishonest when people want to talk shit about PHP when all they know is PHP from 2010 before Composer even existed. However, I've seen internals discussion around this subject and its often brushed off as "let userland do it".
I'm working on enhancements of PHP hosted on AWS Lambda and we can't install or assume Guzzle (or any HTTP library) is available. We have to rely on vanilla PHP and the complexity of trying to make a simple POST request using PHP is something that is intimidating for me with 15 years of experience working with PHP, imagine a newcomer that sees a comparison like this? How would they ever choose a PHP career over something else?
Thanks for listening to my rant.
https://redd.it/1jwogce
@r_php
W3Schools
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
What's the common practice for naming resource routes? I like singular form, but /notification doesn't make much sense for "index" (List of resource)
https://redd.it/1jwr9t4
@r_php
https://redd.it/1jwr9t4
@r_php
HTTP Fixtures to use in tests
I was working on a project recently where I had to integrate with several different APIs. In my tests, I didn’t want to hit all the APIs every time I ran them, so I saved the API responses to JSON files. Then, in my Pest tests, I was loading the JSON files like this:
$json = filegetcontents(dirname(FILE) . '/../../Fixtures/response.json');
Http::preventStrayRequests();
Http::fake(
"https://example.com/api" => Http::response($json, 200)
);
I wanted to remove all sensitive data from the responses and also have more control over their contents. So, I decided to create a package that works similarly to a Laravel Factory. After a few days, I came up with Laravel HTTP Fixtures.
A fixture looks like this and can be generated with an Artisan command by passing a JSON file:
class ExampleHttpFixture extends HttpFixture
{
public function definition(): array
{
return
'status' => Arr::random(['OK', 'NOK'),
'message' => $this->faker->sentence,
'items' =>
[
'identifier' => Str::random(20),
'name' => $this->faker->company,
'address' => $this->faker->address,
'postcode' => $this->faker->postcode,
'city' => $this->faker->city,
'country' => $this->faker->country,
'phone' => $this->faker->phoneNumber,
'email' => $this->faker->email,
],
];
}
}
You can use this in your tests like so:
Http::fake(
"https://www.example.com/get-user/harry" => Http::response(
(new ExampleHttpFixture())->toJson(),
200),
);
For more information, check out the GitHub repo:
👉 https://github.com/Gromatics/httpfixtures
https://redd.it/1jwr31l
@r_php
I was working on a project recently where I had to integrate with several different APIs. In my tests, I didn’t want to hit all the APIs every time I ran them, so I saved the API responses to JSON files. Then, in my Pest tests, I was loading the JSON files like this:
$json = filegetcontents(dirname(FILE) . '/../../Fixtures/response.json');
Http::preventStrayRequests();
Http::fake(
"https://example.com/api" => Http::response($json, 200)
);
I wanted to remove all sensitive data from the responses and also have more control over their contents. So, I decided to create a package that works similarly to a Laravel Factory. After a few days, I came up with Laravel HTTP Fixtures.
A fixture looks like this and can be generated with an Artisan command by passing a JSON file:
class ExampleHttpFixture extends HttpFixture
{
public function definition(): array
{
return
'status' => Arr::random(['OK', 'NOK'),
'message' => $this->faker->sentence,
'items' =>
[
'identifier' => Str::random(20),
'name' => $this->faker->company,
'address' => $this->faker->address,
'postcode' => $this->faker->postcode,
'city' => $this->faker->city,
'country' => $this->faker->country,
'phone' => $this->faker->phoneNumber,
'email' => $this->faker->email,
],
];
}
}
You can use this in your tests like so:
Http::fake(
"https://www.example.com/get-user/harry" => Http::response(
(new ExampleHttpFixture())->toJson(),
200),
);
For more information, check out the GitHub repo:
👉 https://github.com/Gromatics/httpfixtures
https://redd.it/1jwr31l
@r_php
I built Cloudflare Images in PHP (to scale & compress images)
https://youtu.be/lq_YlAOoLT8
https://redd.it/1jwwnlr
@r_php
https://youtu.be/lq_YlAOoLT8
https://redd.it/1jwwnlr
@r_php
YouTube
I built Cloudflare Images in PHP (to scale & compress images)
Prefer to read instead of watch? Here you go! https://aaronfrancis.com/2025/a-cookieless-cache-friendly-image-proxy-in-laravel-inspired-by-cloudflare-9e95f7e0.
In this video I built a very basic version of Cloudflare's image proxy that we use on our various…
In this video I built a very basic version of Cloudflare's image proxy that we use on our various…
The James Brooks' interview
https://preview.redd.it/737lytcapdue1.jpg?width=1280&format=pjpg&auto=webp&s=fb1aa68b54d8781544c01ac41d9c3f5336c4977c
Hello devs !
If you'd like to read the interview with James Brooks in my newsletter and find out more about his work at Laravel , here's the link :
https://go.itanea.fr/wud6
Please, tell me which other member of the Laravel team you'd like to see interviewed in a future episode?
https://redd.it/1jxe1dr
@r_php
https://preview.redd.it/737lytcapdue1.jpg?width=1280&format=pjpg&auto=webp&s=fb1aa68b54d8781544c01ac41d9c3f5336c4977c
Hello devs !
If you'd like to read the interview with James Brooks in my newsletter and find out more about his work at Laravel , here's the link :
https://go.itanea.fr/wud6
Please, tell me which other member of the Laravel team you'd like to see interviewed in a future episode?
https://redd.it/1jxe1dr
@r_php
I didn't think this would work while typing it, but apparently |= is a thing! TIL
https://redd.it/1jxil66
@r_php
https://redd.it/1jxil66
@r_php
🚀 New Tool: Lact – Call Laravel Controller Methods Directly from the Frontend
Hey everyone,
Just wanted to introduce a new open-source tool called Lact, designed to simplify the connection between JavaScript/TypeScript frontends and Laravel backends.
Lact allows frontend developers to call Laravel controller methods directly from the frontend, without manually defining routes or writing repetitive fetch/Ajax logic.
### Key Features:
- 🔁 Skip routes/calling boilerplate – directly invoke controller methods from JS/TS
- 📦 Automatic route generation
- 📘 Works seamlessly with React, Vue, or any JS framework
Inspired by WayFinder the idea behind Lact is to streamline Laravel + JS development and make the backend feel just as accessible as calling a local function.
📚 Documentation: getlact.com
💻 GitHub: msamgan/lact
If you're building Laravel apps with a modern frontend, this might save you some time.
Would love your thoughts – and if you like it, please consider starring the repo ⭐ to support the project!
https://redd.it/1jxopkp
@r_php
Hey everyone,
Just wanted to introduce a new open-source tool called Lact, designed to simplify the connection between JavaScript/TypeScript frontends and Laravel backends.
Lact allows frontend developers to call Laravel controller methods directly from the frontend, without manually defining routes or writing repetitive fetch/Ajax logic.
### Key Features:
- 🔁 Skip routes/calling boilerplate – directly invoke controller methods from JS/TS
- 📦 Automatic route generation
- 📘 Works seamlessly with React, Vue, or any JS framework
Inspired by WayFinder the idea behind Lact is to streamline Laravel + JS development and make the backend feel just as accessible as calling a local function.
📚 Documentation: getlact.com
💻 GitHub: msamgan/lact
If you're building Laravel apps with a modern frontend, this might save you some time.
Would love your thoughts – and if you like it, please consider starring the repo ⭐ to support the project!
https://redd.it/1jxopkp
@r_php
Getlact
Hello from Lact | Lact
Access controller methods directly in your frontend
Looking for new projects ideas
Hi everyone,
I was laid off at the beginning of this year. Since then, I’ve been attending interviews, but I’m still looking for a new opportunity.
Yesterday, I built a small project: a software tool that lets users share a message with a time limit—after the time expires, the link and message are destroyed. I created it mainly to practice my coding skills.
This is the repo: https://github.com/bryanmoreira/expireit
I’d love to hear suggestions for other project ideas, preferably more complex ones. I’m currently struggling to come up with problems that I can solve with code.
Thanks in advance!
https://redd.it/1jxw0pv
@r_php
Hi everyone,
I was laid off at the beginning of this year. Since then, I’ve been attending interviews, but I’m still looking for a new opportunity.
Yesterday, I built a small project: a software tool that lets users share a message with a time limit—after the time expires, the link and message are destroyed. I created it mainly to practice my coding skills.
This is the repo: https://github.com/bryanmoreira/expireit
I’d love to hear suggestions for other project ideas, preferably more complex ones. I’m currently struggling to come up with problems that I can solve with code.
Thanks in advance!
https://redd.it/1jxw0pv
@r_php
GitHub
GitHub - bryanmoreira/expireit
Contribute to bryanmoreira/expireit development by creating an account on GitHub.
A Week of Symfony #954 (April 7–13, 2025)
https://symfony.com/blog/a-week-of-symfony-954-april-7-13-2025?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1jy49gx
@r_php
https://symfony.com/blog/a-week-of-symfony-954-april-7-13-2025?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1jy49gx
@r_php
Symfony
A Week of Symfony #954 (April 7–13, 2025) (Symfony Blog)
This week, Symfony 7.3 entered its feature freeze period in preparation for its release at the end of May 2025. Development activity focused on refining and polishing its new features, including a new…
My tech lead refused to migrate from pure php to Laravel because he doesn't trust them.
Yesterday I had a tense argument with my tech lead and the ceo of our company about our ERP system that is written in pure php. I have suggested that the current codebase is really hard to understand because it does not follow any design pattern. On the other hand, we are hiring new devs soon and it's my responsibility to guide them throughout the code. However, he completely refused and said what if Laravel has been sold to a Chinese company in the future? We don't want to make our fate in their hands.
Are those fears legit? I mean do you think pure php really provides more freedom than Laravel?
https://redd.it/1jy5o2w
@r_php
Yesterday I had a tense argument with my tech lead and the ceo of our company about our ERP system that is written in pure php. I have suggested that the current codebase is really hard to understand because it does not follow any design pattern. On the other hand, we are hiring new devs soon and it's my responsibility to guide them throughout the code. However, he completely refused and said what if Laravel has been sold to a Chinese company in the future? We don't want to make our fate in their hands.
Are those fears legit? I mean do you think pure php really provides more freedom than Laravel?
https://redd.it/1jy5o2w
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Weekly /r/Laravel Help Thread
Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:
What steps have you taken so far?
What have you tried from the documentation?
Did you provide any error messages you are getting?
Are you able to provide instructions to replicate the issue?
Did you provide a code example?
Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.
For more immediate support, you can ask in the official Laravel Discord.
Thanks and welcome to the r/Laravel community!
https://redd.it/1jyccy5
@r_php
Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:
What steps have you taken so far?
What have you tried from the documentation?
Did you provide any error messages you are getting?
Are you able to provide instructions to replicate the issue?
Did you provide a code example?
Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.
For more immediate support, you can ask in the official Laravel Discord.
Thanks and welcome to the r/Laravel community!
https://redd.it/1jyccy5
@r_php
Laravel
Installation - Laravel 12.x - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Currently, what’s the best Laravel Next.js starter available out there?
People use it? next with laravel api first?
Ive been doing a package and just got curious about the current choices out there. And well, surprising no one, it’s another one like wayfinder
but mine uses attributes instead of complete auto discovery, but generates models, requests, controllers, validation, routes
all typed ready to do api calls
https://redd.it/1jyd07r
@r_php
People use it? next with laravel api first?
Ive been doing a package and just got curious about the current choices out there. And well, surprising no one, it’s another one like wayfinder
but mine uses attributes instead of complete auto discovery, but generates models, requests, controllers, validation, routes
all typed ready to do api calls
https://redd.it/1jyd07r
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
Weekly Ask Anything Thread
Feel free to ask any questions you think may not warrant a post. Asking for help here is also fine.
https://redd.it/1jyp9dj
@r_php
Feel free to ask any questions you think may not warrant a post. Asking for help here is also fine.
https://redd.it/1jyp9dj
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
Weekly help thread
Hey there!
This subreddit isn't meant for help threads, though there's one exception to the rule: in this thread you can ask anything you want PHP related, someone will probably be able to help you out!
https://redd.it/1jyrvsh
@r_php
Hey there!
This subreddit isn't meant for help threads, though there's one exception to the rule: in this thread you can ask anything you want PHP related, someone will probably be able to help you out!
https://redd.it/1jyrvsh
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
How I Build SaaS Using Backpack for Laravel
https://backpackforlaravel.com/articles/tutorials/how-to-build-saas-using-backpack-for-laravel
https://redd.it/1jysm25
@r_php
https://backpackforlaravel.com/articles/tutorials/how-to-build-saas-using-backpack-for-laravel
https://redd.it/1jysm25
@r_php
Backpack for Laravel
How to Build SaaS Using Backpack for Laravel
In the previous article, I showed you how to build a CRM using Backpack for Laravel. Now, let’s take it a step further and turn it into...