PHP Reddit – Telegram
PHP Reddit
34 subscribers
292 photos
37 videos
24.9K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
How Much Memory Does A Worker Use?

Yep, I get the logical fallacy here. May as well ask how long is a rope. BUT...I'm wondering from your experience what have you seen as an average in your projects? I'd like to do some basic calculations to estimate how much ram my VPS will need for an upcoming project. Not looking for anything exact, just roughly.

If you would like, you can assume my project will be extensive and lots of features and tools. Complex.

https://redd.it/1jeag1a
@r_php
Should I learn PHP or .NET?

I already know web development with react and next js and I wanted to learn something related backend to upscale myself I don’t want to learn node although I know how it works (don’t know how to code in it) I’m confused between PHP and .NET.

https://redd.it/1jem95k
@r_php
Form still submit through live component instead of symfony controller

Where am I doing it wrongly?

I have the live component extends abstract controller with defaultactiontrait and compnentwithformtrait as per documentation and create form via instantiateForm.

Inside symfony controller I have created form as usual and then pass the form to live component via twig as per documentation.

When it rendered first time, the form created in symfony controller is used. But when I submit, it appears live component form is submitted instead.

My impression is there is seperate form instance being created when a refresh is done in live component.

I saw in symfony profile, there r two POST, first one was for symfony controller and second POST was for live component.

https://redd.it/1jeozl1
@r_php
Who's hiring/looking

This is a bi-monthly thread aimed to connect PHP companies and developers who are hiring or looking for a job.

Rules

No recruiters
Don't share any personal info like email addresses or phone numbers in this thread. Contact each other via DM to get in touch
If you're hiring: don't just link to an external website, take the time to describe what you're looking for in the thread.
If you're looking: feel free to share your portfolio, GitHub, … as well. Keep into account the personal information rule, so don't just share your CV and be done with it.

https://redd.it/1jesouk
@r_php
Can't Livewire be smart enough to detect Alpinejs is already installed on the project and not install(run) it again?

I've spent 3 hours trying to solve an issue with a volt component today. I had an input with a variable binded with wire:model attribute. And I just couldn't get the variable to change. Every other thing was working on the app though, it successfully created a DB record, but just didn't empty the text input no matter what I did.

Some of the things I tried : $a = $this->pull('string'), $this->reset('string'), and even straight up $this->string = "";

Then I remembered I started this project with Breeze auth (which comes with alpinejs), and then I installed livewire/volt which apparently also runs alpinejs in the background.

I'm 100% aware that this particular case was a skill issue, since simply opening the Dev tools console showed what was causing the error; Detected multiple instances of Alpine running

But the thing is, I was writing PHP code the whole way. And you don't debug with Dev tools console when you're writing PHP. That's why I wasted 3 hours looking everywhere for a bug except the console.

So, back to my question: is it not possible to add some conditions to check if alpinejs already initialized in the app.js file, so that both of these first (and almost-first) party Laravel packages wouldn't conflict with each other when installed on a brand new project?

https://redd.it/1jf3dbc
@r_php
Best practice for Vue integration

Hey all,

As per noscript, wdyt is the best way to use Vue with Symfony?

I found some old articles and I see Symfony UX explained a little on the website but I would like some insight if anyone has it, or some resources.

Cheers!

https://redd.it/1jf76o6
@r_php
Why doesn't laravel have the concept of router rewriting

A concept found in the zend framework (and i likely others) is route rewriting, so if you had `/products/{product:slug}`, it could be hit with `/{product:slug}` if configured that way.

Its currently impossible to have multiple routes that are a single dynamic parameter, so if i want to have user generated pages such as /about and /foobar created in a cms, and then also have products listed on the site, such as /notebook or /paintbrush, i would have to register each manually, and when the DB updates, trigger 'route:clear' and 'route:cache' again.

Rewrites would be a powerful tool to support this in a really simple way, is there any reasoning why it isnt used, or is this something that would be beneficial to the community?

Edit: to clarify, what i want to have as a mechanism where you can register two separate dynamic routes, without overlapping, so rather than just matching the first one and 404 if the parameter cant be resolved, both would be checked, i have seen router rewriting used to achieve this in other frameworks, but i guess changes to the router itself could achieve this

if i have

Route::get('/{blog:slug}', [BlogController::class, 'show']);

Route::get('/{product:name}', [ProductsController::class, 'pdp']);

and go to /foo, it will match the blog controller, try to find a blog model instance with slug 'foo', and 404 if it doesn't exist, IMO what SHOULD happen, is the parameter resolution happening as part of determining if the route matches or not, so if no blog post is found, it will search for a product with name 'foo', if it finds one match that route, if not keep checking routes.

https://redd.it/1jfc2ao
@r_php
Why doesn't laravel have the concept of router rewriting

A concept found in the zend framework (and i likely others) is route rewriting, so if you had `/products/{product:slug}`, it could be hit with `/{product:slug}` if configured that way.

Its currently impossible to have multiple routes that are a single dynamic parameter, so if i want to have user generated pages such as /about and /foobar created in a cms, and then also have products listed on the site, such as /notebook or /paintbrush, i would have to register each manually, and when the DB updates, trigger 'route:clear' and 'route:cache' again.

Rewrites would be a powerful tool to support this in a really simple way, is there any reasoning why it isnt used, or is this something that would be beneficial to the community?

Edit: to clarify, what i want to have as a mechanism where you can register two separate dynamic routes, without overlapping, so rather than just matching the first one and 404 if the parameter cant be resolved, both would be checked, i have seen router rewriting used to achieve this in other frameworks, but i guess changes to the router itself could achieve this

if i have

Route::get('/{blog:slug}', [BlogController::class, 'show']);

Route::get('/{product:name}', [ProductsController::class, 'pdp']);

and go to /foo, it will match the blog controller, try to find a blog model instance with slug 'foo', and 404 if it doesn't exist, IMO what SHOULD happen, is the parameter resolution happening as part of determining if the route matches or not, so if no blog post is found, it will search for a product with name 'foo', if it finds one match that route, if not keep checking routes.

https://redd.it/1jfc6qi
@r_php
Google Cloud Pub Sub Multiple Subnoscriptions

Hey everyone,

At my work, we run a Symfony 7.2 app within Google Cloud, and we have an in-house written process that will pull from the various subnoscriptions we have and process messages.

I've now been tasked with rewriting this and integrating it into Symfony Messenger. That challenge is that for ... reasons (https://github.com/symfony/symfony/issues/44635), Symfony Devs refuse to write an integration for Messenger.

This leaves me looking at packages like petit press messenger https://github.com/petitpress/gps-messenger-bundle, however I have 2 basic requirements:

It must support multiple topics/subnoscriptions
I must have the option of cycling through the subnoscriptions and pulling messages, like a round robin. (So pull 10 from Sub A, 10 from Sub B etc)

Petit Messenger doesn't do either of these as far as I can tell, so was part way through writing my own.

I guess the challenge with this will be how I link a message back to a queue to be able to acknowledge it.

Just wondering if anyone else has had to do something similar, and what was your solution.

Cheers

https://redd.it/1jfk21i
@r_php
Scaling PHP for Real-World Applications: Seeking Your Feedback on My Newsletter

As the noscript says, I'm looking for feedback and critique. Every year we hear from someone about the fictional death of the immortal PHP =). But as a CTO specializing in PHP refactoring, I see its immense potential for scaling. I've launched a “PHP at Scale” newsletter — my monthly deep dive into best practices, architecture patterns, and real-world use cases of PHP in large, complex applications. https://phpatscale.substack.com

Getting meaningful critique and improvement suggestions is hard as you start a newsletter like this, so I hope you guys can get me some. The idea for this newsletter is to help the community, so I will value any ideas or opinions.  

As of right now, my newsletter has 7 issues, some of the topics I’ve tried to cover practically:

PHP's place in the modern web development scene
Keeping code-base up-to-date
Day-to-day rules we can follow to improve our code
Improving performance
Documentation
My interview with Roman Pronskiy (CEO of the PHP Foundation) + some business perspective on PHP 

Specific Questions for Your Feedback:

What are the most significant scaling challenges you're currently facing in your PHP projects?
Are there any specific architecture patterns or best practices related to PHP scaling that you would be most interested in reading about in the newsletter?
Are there any specific topics you would like covered in future issues?
What is your preferred newsletter length and frequency?

I value your insights and opinions. Hope you’ll find something useful for yourself in my newsletter, if you do - consider subscribing. 



https://redd.it/1jfs9m1
@r_php
Need Better Custom IDs in Laravel? Check Out Laravel ID Generator! 🚀

https://preview.redd.it/72c4ppqpzwpe1.png?width=1738&format=png&auto=webp&s=82f5f0a5fb2e6b2fabcbb7c34575b89adf0a6ffd

We’ve all been there—working on a Laravel project and realizing that auto-incremented IDs or UUIDs just don’t cut it. Whether it’s for invoices, orders, or any structured numbering system, we need something better.

So, I built Laravel ID Generator—a simple yet powerful package that makes generating structured, readable, and customizable IDs effortless!

Features:
✔️ Unique IDs with custom prefixes, suffixes, dates, and more
✔️ Seamless integration with Eloquent models
✔️ Ideal for invoices, receipts, orders (e.g., INV-0005/2025)
✔️ Flexible & requires zero configuration

🔗 GitHub Repo: https://github.com/omaressaouaf/laravel-id-generator

If you’re working with Laravel and need better ID management, check it out! Would love your thoughts, feedback, or contributions. 🚀

https://redd.it/1jg0dm9
@r_php
How to effectively block bots?

Good morning,

How to block the 200 accounts that automatically register on your site?

https://redd.it/1jgd7qa
@r_php
new uptime monitor application written with laravel!

Hello to all,

I am working on an uptime monitoring and incident management application. written in php 8 (with laravel framework). Fully dockerized, easy installation.

https://apphealer.io
https://github.com/AppHealer
https://facebook.com/AppHealer
https://linkedin.com/company/AppHealer/

Please be kind and give me some support (sharing, followers on linkedin/facebook, github stars etc) or any kind of opinions / feature requests / pull requests. :)

have a nice day! :-)



https://redd.it/1jgeai7
@r_php
Doxswap Feedback 💬 What formats do you most often convert Markdown to and from?

I'm working on the v1 release of Doxswap — a Laravel package for document conversion. The pre-release got a great response. You can take a look at the current v1 progress ere https://github.com/Blaspsoft/doxswap/tree/doxswap-v1.0.0

Right now I’m focusing on adding Markdown conversions, and I’d love to understand how people actually use it in the wild:

What formats do you most often convert Markdown into or from?
e.g.
markdown --> html

html -> markdown

markdown -> pdf

markdown -> epub

Drop your thoughts below — I'm aiming to make Doxswap flexible, but I want to prioritize the real-world cases that matter most to devs.

Thanks in advance for your input!

https://redd.it/1jgf9ur
@r_php