PHP Reddit – Telegram
PHP Reddit
34 subscribers
286 photos
36 videos
24.7K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
WSL2 development environment for PHP projects with little to no fuss

PHP is great, but setting up a truly functional development environment is a pain. There are so many moving parts I sometimes feel I'm wasting more time on the environment than on coding.

I remember using XAMPP back in the day - when it was still the go-to solution. Somebody should tell them that PHP 8.3 was released. And PHP 8.4. Even 8.5. Get with the program...

So I started reading about a WSL development environment which seems to hit the right marks:

An environment that matches the production one closely. This prevents surprises when I release my code.
Full freedom to set up what I need, when I need it. Sometimes too much freedom.
A virtual machine sandbox that is separate from my main system. I don't have to worry about stuff escaping the virtual machine and deleting my games... I mean my totally-legit, work-related stuff.
I can pick my preferred Linux distribution, which makes it a breeze to change versions for each component. No more uninstalls and reinstalls every time I'm switching projects.

But that freedom thing I mentioned above is the one that worries me. A WSL recipe with Ansible provides the fix. It sets everything up: PHP, Apache, MariaDB, Git, Composer, PhpMyAdmin. Then I can start coding, maybe add some vhosts along the way.

The big part of the setup is covered in this article.

What do you guys use for your development envoronments?

https://redd.it/1povij7
@r_php
My Message to Laravel TEAM

Concern About Laravel’s Direction & Request for Stable, Bootstrap-Friendly Alternatives

My Message to Laravel TEAM

I’ve been a passionate Laravel developer for nearly a decade. Laravel’s early alignment with Bootstrap via laravel/ui played a huge role in my adoption—and advocacy—of the framework. Over the years, I’ve shipped numerous projects and actively recommended Laravel to peers and teams.

However, with recent shifts—especially the strong push toward Tailwind CSS, Inertia, Livewire, and ecosystem monetization (e.g., Forge, Vapor, paid packages)—I’m finding it increasingly difficult to stay aligned with Laravel’s direction.

As someone who values simplicity, stability, and proven stacks (PHP + Blade + Bootstrap), I feel the framework is drifting away from developers like me—the ones who helped grow Laravel organically in its early years—toward a more opinionated, JavaScript-heavy, and commercialized approach.

The deprecation of laravel/ui and the focus on Breeze/Breeze + Inertia have made starting new projects with my preferred stack unnecessarily complex. Laravel 12, in particular, feels like a departure from the philosophy and ergonomics I fell in love with in Laravel 5–11.

I’m now seriously considering alternatives:

CodeIgniter 4 is tempting (I loved v3), but I’m unsure if its ecosystem is mature enough for larger applications today.
Are there other stable, well-documented PHP frameworks that prioritize convention over configuration, support clean MVC, and make it easy to use Blade (or plain PHP) with Bootstrap—without forcing frontend tooling or paid add-ons?

I’m not resistant to change—but I am resistant to churn without clear, inclusive justification. Laravel used to excel at balancing innovation with stability. I hope it finds that balance again.

Thank you for listening.

https://redd.it/1pp0y1n
@r_php
Inertia best practice

I’m mainly backend dev and worked for years with frontend/backend communicating through an API layer.

Now I have an Inertia project where I often feel like that I’m working against the framework. I have some concerns where I want to know what the best practice way of handling such scenarios is.

1. Dealing with large Datasets

I have multiple pages where I have a lot of data that gets transmitted to Frontend. The docs don’t give much info about this but what’s the best way of dealing with this. Especially on subsequent data reloads (ie after form submission or router.reload). I know I can provide the ‘only’ parameter but that still has to run the controller function and thus, all the other code not necessarily required for that few requested parameters. The only current solution I see would be a closure. But this doesn’t feel very “finished” as it forces a lot of duplicate code and overall makes the code look ugly.

2. Dynamic requests

Let’s say there is some button that the user can interact with that triggers something beyond CRUD. Currently in the codebase these are done with plain axios requests. But those completely ignore the Inertia ecosystem. I feel like that’s kind of the wrong approach of doing it. The controllers on the backend side are therefore mixed with inertia and json responses.

3. Error handling

This is currently all over the place. Inertia has a beautiful way of displaying errors. Because dynamic requests aren’t within the ecosystem, it doesn’t apply to those requests. I have my own complete approach of correcting this but I wanted to hear if there is maybe already a best-practice way of doing this. This is also a general Laravel concern. Coming from Spring, everything error related is done through exceptions. Does that fit for Laravel too?

https://redd.it/1pp412t
@r_php
Claude Code plugin Symfony ! Superpowers

🚀 New Claude Code Plugin: superpowers-symfony 🚀

Hey everyone! I just published a new Claude Code plugin for Symfony developers: superpowers-symfony — a plugin that brings Symfony-specific guidance, skills, and workflows straight into Claude! GitHub

📦 Features include:
✔️ TDD workflows using Pest or PHPUnit
✔️ Doctrine ORM mastery (relations, migrations, fixtures)
✔️ API Platform patterns & DTO guidance
✔️ Symfony Messenger async support
✔️ Security best practices & voters
✔️ Architecture patterns (hexagonal, DI, CQRS)
✔️ Quality tooling (PHP-CS-Fixer, PHPStan, etc.)
✔️ Docker + Symfony support (FrankenPHP & standard compose) GitHub

💡 What it does:
This plugin adds a collection of expert-level skills that Claude can use to help with common Symfony tasks — from writing tests to building APIs and structuring apps.

Give it a try and let me know what you think! 🙌



https://redd.it/1pppbiz
@r_php
How realistic is it to freelance part-time as an aspiring software developer?

Hi everyone,
I’m an aspiring software developer (currently training as a Fachinformatiker Application Development) and I’m thinking about doing small freelance jobs on the side (just a few hours per week). How realistic are my chances with my current skill level, and what would be good first steps to get real clients?

What I can currently do / offer (small, clearly scoped tasks):

Plain PHP + MySQL: bug fixes, small features, CRUD, forms, validation

SQL: fixing/optimizing queries, simple database structures

Basic JavaScript: small fixes (events, buttons, form logic)


I’ve already created profiles on a few platforms like Fiverr or Malt. I’m not sure whether linking profiles is allowed here, so I’ll only share them if explicitly requested.

https://redd.it/1ppq0xk
@r_php
Small PHP + SQLite web app for managing custom ZIP-based file formats

I’m sharing a small PHP project that manages a custom ZIP-based file format ( .broccoli ) via a web UI.

Tech stack:

PHP (no framework)
SQLite
ZipArchive
Self-hosted, file-based workflows

Repo: https://github.com/crispilly/brassica
Use case: managing Broccoli recipe files in the browser.

Happy to hear feedback on structure or security aspects.

https://redd.it/1pqfmz4
@r_php
Pitch Your Project 🐘

In this monthly thread you can share whatever code or projects you're working on, ask for reviews, get people's input and general thoughts, … anything goes as long as it's PHP related.

Let's make this a place where people are encouraged to share their work, and where we can learn from each other 😁

Link to the previous edition: /u/brendt_gd should provide a link

https://redd.it/1pqgieq
@r_php
I wrote a thing... wanna help me break it?

https://github.com/ssnepenthe/symbol-extractor

You give it a file path as input and it gives you back a list of classes, enums, functions, interfaces, and traits declared within that file as output.

It's pretty simple but PHP can be weird so I am sure there are edge cases I am missing.

Is anyone willing to take some time to try to come up with examples of valid PHP that breaks it?

https://redd.it/1pqocta
@r_php
A backoffice for people who don’t use Laravel (yes, we still exist)

I’m experimenting with a framework-free PHP backoffice/admin tool I built and would love some feedback from the community.

I mainly work on custom PHP projects, especially platforms for managing clinical and research data. In these contexts, adopting a full-stack framework like Laravel or Symfony isn’t always practical.
Over time, I often found myself building backoffices and admin interfaces from scratch, so I started experimenting with a small, framework-free solution of my own.
The main goal was long-term readability: PHP code that I can easily understand and modify even months later. Defining tables and edit forms should take just a few lines, while keeping the control flow explicit and easy to follow.
For the same reason, I made deliberately conservative technical choices: plain PHP, Bootstrap for layout, no template engine, and no JavaScript dependencies. In my experience, stacking frameworks, template engines, and JS libraries makes long-term maintenance harder, especially for small or regulated projects.
Conceptually, it’s inspired by tools like Filament, but simpler, less ambitious, and without Laravel behind it. It’s not meant to compete with Laravel, WordPress, or anything similar. The project is still in alpha, so no guarantees regarding stability or completeness.
I’m curious whether this kind of approach still makes sense in today’s PHP ecosystem. I’ve shared the code (MIT) and a short write-up explaining the design choices. Feedback is welcome, including critical opinions.

If anyone’s curious, here are the link:
https://github.com/giuliopanda/milk-admin




https://redd.it/1pqpq9r
@r_php
Mago 1.0.0: The Rust-based PHP Toolchain is now Stable (Linter, Static Analyzer, Formatter & Architectural Guard)

Hi r/PHP!

After months of betas (and thanks to many of you here who tested them), I am thrilled to announce **Mago 1.0.0**.

For those who missed the earlier posts: Mago is a unified PHP toolchain written in **Rust**. It combines a Linter, Formatter, and Static Analyzer into a single binary.

**Why Mago?**

1. **Speed:** Because it's built in Rust, it is significantly faster than traditional PHP-based tools. ([See the benchmark](https://mago.carthage.software/benchmarks)).
2. **Unified:** One configuration (`mago.toml`), one binary, and no extensions required.
3. **Zero-Config:** It comes with sensible defaults for linting and formatting (PER-CS) so you can start immediately.

**New in 1.0: Architectural Guard**

We just introduced **Guard**, a feature to enforce architectural boundaries. You can define layers in your `mago.toml` (e.g., `Domain` cannot depend on `Infrastructure`) and Mago will enforce these rules during analysis. It’s like having an architecture test built directly into your linter.

**Quick Start**

You can grab the binary directly or use Composer:

```bash
# Via Composer
composer require --dev carthage-software/mago

# Or direct install (Mac/Linux)
curl --proto '=https' --tlsv1.2 -sSf https://carthage.software/mago.sh | bash
```

**Links**

* **GitHub:** https://github.com/carthage-software/mago
* **Documentation:** https://mago.carthage.software
* **Playground:** https://mago.carthage.software/playground

A huge thank you to the giants like PHPStan and Psalm for paving the way for static analysis in PHP. Mago is our take on pushing performance to the next level.

I'd love to hear what you think!

https://redd.it/1pr1725
@r_php
Appreciation post for Laravel

In my 9-5 I am a .NET / React developer. I run a small side gig building web apps for smaller clients where my primary tech stack is Laravel with React + Inertia.

My developer experience coming from ASP.NET to Laravel is immeasurably better. What would take multiple dev teams in a corporate environment months to build in .NET, I can build in a week or just a few days in Laravel.

Need a message queue? It’s in the box.

Need real-time communication with your frontend? In the box.

Don’t want to duplicate your validation rules in your frontend and backend? Laravel has it.

Need an events system, mail service, notifications pattern? Just read the docs.

I love Laravel because they champion what’s new and innovative in the open source community. The documentation is outstanding, the community has tons of resources and is generally focused on making the framework as powerful as possible for us.

I hope adoption at the enterprise & startup levels increases, because this framework is doing so much more than the others.

https://redd.it/1prdyb0
@r_php
Hunting down exploited sites in shared hosting for not-for-profit association

I'm trying my best to figure out the ways of cleaning out different kinds of webshells and what not that seem to be dropped though exploited Wordpress plugins or just some other PHP software that has an RCE.

Cannot really keep people from running out-of-date software without a huge toll on keeping signatures in check, so what's the best way to do this? We seem to get frequent abuse reports about someone attacking 3rd party wordpress sites though our network (which trace back to the servers running our shared webhosting and PHP)

I was thinking of auditd, but not sure if that's a good way as we have thousands of users which not everyone is running PHP, but all sites are configured for it. Is hooking specific parts of like connect/open_file_contents or something of those lines a good approach? I have a strong feeling that may break a lot of things.

Some information on the environment:

\- grsecurity
\- Custom kernel patch that prevents normal users from accessing other user's files, no matter the UNIX permissions
\- Apache with PHP-FPM and each shared hosting user has their own pool per PHP version (3 major versions are usually supported but only one is active for each vhost)

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