PHP Reddit – Telegram
PHP Reddit
34 subscribers
289 photos
37 videos
24.8K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
Your tools for a redesign

Hello everyone.

I am in a project where there is a possible redesign (because the successive version upgrade will be too costly).

The announced objective is Symfony7 with PHP 8.4 (or 8.5 if available). Do you have tools to maintain maintainable code in the long term.

I already know SOLID, clean code, clean architecture, screaming architecture, phpunit.

I cannot use xdebug because it is too demanding because the VMs are managed on a potato.

https://redd.it/1m9n3ic
@r_php
Debugging sucks in PHP and things should change!

Hi, creating this post in the hope that php foundation will give some care to improve the debugging experience in php.

Reason being that almost all people i know do not use xdebug, even experienced devs.

It seems people found it hard to setup initially and they have grown without it. If in another language the first thing you do is start debugging, most php devs will just go the old fashion way, dd/print etc.

I myself have only managed to have xdebug working twice on phpstorm, same on vscode but for whatever reason vscode seams easier to setup. Its hard, it can easily go wrong, even when done right you sometimes mess the xdebug config and now the page takes twice to load. Add the fact that you setup multiple projects with different environments, it gets messy.

The debugging experience just isnt there, you may say its easy and you are right to a degree, but many things can go wrong and seeing most software php shops with a debugging session is a rare occurrence, that should give a hint why.

Debugging should be built within php, i consider this one of the most important things in the level of async and generics.

I'm thankful to the php foundation for bringing the language forward, even with their small resources, but if setting this up doesnt cost an arm and a leg it should be done.

P.S. please dont tell me its easy and a skill issue, it aint as easy and it should be way easier, the usage reflects it.

https://redd.it/1m9zyem
@r_php
Why do people use repositories for getting DB records in Laravel

For me personally, I don't like using repositories in laravel... why, because it makes no sense, at the end of the day you are going to use the model to fetch data from DB, and if you need a reusable logic for your queries, you can use scopes or queury builds. I still see people building Laravel projects using repositories and it's always end up being chaotic. And you will actually end up writing the same logic for the query and duplicating the code because you don't want to touch the repository function which may break something else in the app.
For other frameworks like Symfony, repositories makes sense but not in Laravel.
I want to know your opinion about using Repositories in laravel, do you think that it can be useful or it's just something people coming from other framework do because they are used to it.

https://redd.it/1ma0y9m
@r_php
Built a production-ready CRM in PHP 8.3 with 99.6% type coverage - lessons learned from 8 years of PHP development

Hi r/php!

I've been developing in PHP for 8+ years, and I recently launched Relaticle, an open-source CRM that represents everything I've learned about building maintainable PHP applications.

Technical highlights:

PHP 8.3 with strict types everywhere
99.6% type coverage (measured by PHPStan level 7)
Full use of PHP 8 features: attributes, enums, readonly properties, constructor property promotion
MVC architecture with action pattern
Comprehensive error handling with custom exception classes

Architecture decisions:

Service layer pattern for business logic separation
Action classes for complex operations
DTOs for data transfer between layers
Event-driven architecture for extensibility
Database transactions with proper rollback handling

Performance optimizations:

Implemented query result caching with Redis
Optimized N+1 queries throughout
Built a custom field system that scales efficiently
Lazy loading for heavy resources

The biggest challenge was creating a dynamic custom fields system that maintains performance even with hundreds of fields. Solved it through clever caching strategies and optimized database queries.

It's production-ready (v1.x) and actively used. Looking for experienced PHP developers who want to collaborate and share knowledge.

Demo: https://relaticle.com
GitHub: https://github.com/Relaticle/relaticle

What architectural patterns have worked best for your large PHP projects?

https://redd.it/1maer2h
@r_php
Advice on finding job in this madness

Hi, it's been 9 months since I got laid off randomly from my company, since then, I just wasted hours on sending CVs and doing interviews that led to absolutely nothing.

I have been ghosted after the 2nd interview and then saw them posting the same advert since then every week, or wasted my time doing tests and stupid interviews for basic roles, then during the interview the role became an entire department because "we are a small company, we need to be multitasking".

I have a good amount of experience, both front and back end, but since I am a PHP dev, now I am stupid because "PHP Is DeAddd!!1!111".

I have worked extensively with WordPress (I know I lot of people hate it, but what can I do, it pays the bills), I also did a lot of procedural PHP, worked with Laravel and Zend, but it seems like it's never enough.

I know we are all in the same boat, more or less, but I cannot see a way of finding a job now. If I apply for "normal" jobs, just to have some money, I get no response, if I apply for my job, same crap. What I am supposed to do? Sell drugs at this point I think.

Unfortunately I cannot even start my own business, so that's not an option.

Thought about Envato and similar, but it's just too late to sell stuff on that.

Fiverr etc are a battleground for who does it at the lowest price.

LikedIn is just useless, Indeed quite similar. I tried also other websites like WeWorkRemotely and similar but most of the jobs are JS related.

Any other website I can try? I mean, I also spammed my CV to companies found on google from big to small.

I think a good option now would be to be like Ranma, I could become a woman with cold water and open an OnlyFans account.

https://redd.it/1magmxm
@r_php
Built a production-ready Open-Source CRM with Laravel 12 & Filament 3 - Solved some interesting performance challenges with custom fields
https://redd.it/1maktn0
@r_php
Laravel Sanctum SPA Auth Flow with Bruno (Postman alternative)

Hey everyone,

I previously shared a Postman-based Laravel Sanctum auth setup, and a lot of you commented that Postman is dead — especially after the recent issue where it was found sending secret values to their analytics servers.

🔗 https://anonymousdata.medium.com/postman-is-logging-all-your-secrets-and-environment-variables-9c316e92d424

So, I rebuilt the whole flow using Bruno — an open-source, local-first API client.

🔗 New repo: https://github.com/maikeru-desu/laravel-sanctum-bruno-authentication

This guide walks through the typical SPA auth setup:

CSRF cookie flow
Login with XSRF protection
Testing protected routes
Reusable pre-request noscripts

If you’re building a Laravel SPA and want to test it properly without leaking anything, this should be a good fit.

Star it if it helps you out — or just like it so others can find it too.

https://redd.it/1mapj37
@r_php
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/1margw0
@r_php
Any of you do event sourcing with symfony ?

I recently (well, I’ve been working on it for a year) learned event sourcing. As a result, I created my own event sourcing framework called FluxCapacitor.

It’s GDPR compliant, as I encrypt data with personalData attributes in my domain events and decrypt it when rebuilding my aggregates. If I could find some people who know the subject to check my repository and provide feedback on my implementation, that would be amazing .

Here’s my GitHub: https://github.com/GremaudMatthieu/budget .
You can find the Symfony project in the backend folder. My event sourcing framework is in the libraries folder, and you can see how I implement it in the rest of the project! Thank you for your time! I look forward to your feedbacks!

https://redd.it/1mauic7
@r_php
Why Use Livewire or Filament?

Hey everyone,

I recently looked into some benchmarks, and the numbers are pretty eye-opening. When it comes to Time to Interactive (TTI), memory usage, and concurrent user capacity, Livewire and Filament consistently lag behind more traditional or decoupled approaches.

Here's a quick rundown of what I found:

Time to Interactive (TTI)

Laravel Blade: 200-500ms
Laravel + Inertia + Vue: 1-3s
Laravel Filament: 2-8s (can reach 10-18s with issues)
Laravel API + SPA: 3-10s (initial load)

Memory Usage (server)

Laravel Blade: 32-64MB per request
Laravel + Inertia + Vue: 64-128MB per request
Laravel Filament: 128-256MB per request
Laravel API + SPA: 16-32MB per request

Concurrent Users Capacity

Laravel Blade: 500-1000+ users
Laravel + Inertia + Vue: 300-600 users
Laravel Filament: 100-300 users
Laravel API + SPA: 1000+ users

While the development speed of these tools is attractive, are we sacrificing too much in terms of user experience and scalability? For projects where performance is a key metric, it seems like Laravel Blade or a Laravel API + SPA setup still offer significant advantages.

What are your thoughts? Has anyone else experienced similar performance bottlenecks with Livewire or Filament in production, or found effective ways to mitigate them?

Let's discuss!

https://redd.it/1mawpx7
@r_php
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/1mb5gnv
@r_php
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/1mb8dod
@r_php
43 stars on my Laravel Chat package!

Just got my 43rd star for Le Chat \- my Laravel chat package!


Thank you to the community!

https://redd.it/1mb9lgd
@r_php
PHP is evolving, but every developer has complaints. What's on your wishlist?

PHP continues to rule the web in 2025 (holding about 75% of the market), and has been developing actively lately, keeping up with the competition. Things are pretty good today, but there are drawbacks. I'm sure every PHP developer has some things that don't satisfy them and they would like to see fixed.

For example, I don't really like the official PHP website. It looks like it's stuck in the early 2000s. Minimalism is one thing, but outdated design, inconvenient navigation and lack of modern features make it irrelevant for newcomers.

But the most important thing - newcomers don't understand where to start at all! You go to the "Download" section - there's a bunch of strange archives, versions, in the documentation there are big pages of text, but where's the quick guide? Where are the examples? Where's the ecosystem explanation? A person just wants to try PHP, but gets a "figure it out yourself" quest. This scares people away from the language! Imagine a modern website with:

* Clear getting started for beginners
* Convenient documentation navigation
* "Ecosystem" section with tools, frameworks, etc.

What's your main idea? Bold suggestions are welcome - strict typing by default, built-in asynchronicity? Let's brainstorm and maybe PHP core developers will notice the post and take it into consideration!

https://redd.it/1mbaeo9
@r_php
v0.5 - Powerful And API-Ready AI Agents For Laravel

LarAgent v0.5 released!

Now you can:

* Expose agents via API, compatible with OpenAI, connect your Agent to any OpenAI client - easily ,
* Multimodal inputs, send messages now with Audio ,
* Send ready UserMessage instance instead of text messages,
* Receive MessageInterface instance instead of string/array (Using returnMessage()),
* Use Groq as your LLM provider,
* Choose tool handling strategy: none, required, forced,
* Use PhantomTool to handle tool execution outside of LarAgent


Check the summary of new features and changes here: [https://blog.laragent.ai/laragent-v0-5-powerful-and-api-ready-ai-agents-for-laravel/](https://blog.laragent.ai/laragent-v0-5-powerful-and-api-ready-ai-agents-for-laravel/)

https://redd.it/1mbfk64
@r_php
Strict comparison with null instead of boolean check, just style or are there other reasons?

In many projects, especially symfony, you will find null checks written like this:
function my_func(?string $nullable = null) {
if (null === $nullable) {
// Do stuff when string is null
}
}


But I would normally just write:
// ...
if (!$nullable) {
// Do stuff when string is null
}



Are there specific reasons not to use the second variant?
Is this style a fragment from the past where type hints were not yet fully supported?

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