PHP Reddit – Telegram
PHP Reddit
34 subscribers
294 photos
39 videos
25K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
Life Timeline: Real-time multiplayer app built with Swoole + Mezzio

Demo: [https://timeline.zweiundeins.gmbh](https://timeline.zweiundeins.gmbh)
Github: [https://github.com/mbolli/php-timeline](https://github.com/mbolli/php-timeline)

I just put my Life Timeline app in production. It's a horizontal timeline app (think Google Sheets timeline view meets Adobe Premiere's track layout) with real-time multiplayer.

I was interested in Swoole's performance but found most examples are either single-file noscripts or custom frameworks. I wanted to see if you could build a "proper" PHP application (PSR-15 middleware, dependency injection, structured architecture) while still benefiting from Swoole's persistent workers. Spoiler: you can, and Mezzio makes it pretty seamless.

**The real-time architecture:** The multiplayer sync uses a pattern I really like:

* **CQRS (Command Query Responsibility Segregation):** Write operations go through Command Handlers, reads through Query Handlers. Each command handler does its thing (update database) and then emits an event.
* **Event Bus:** When a command completes, it fires a `TimelineChangedEvent` to a Swoole-based event bus. This is just a simple pub/sub: The bus holds subscriber callbacks in memory (works because Swoole workers are persistent).
* **SSE (Server-Sent Events):** When clients connect to `/updates`, they subscribe to the event bus. The connection stays open (Swoole coroutines handle this efficiently). When any client makes a change, the event fires, all subscribers get notified, and we push a re-rendered HTML fragment to each client using [Datastar](https://data-star.dev/)'s `PatchElements` format.

The nice thing is there's no WebSocket complexity, no separate pub/sub server (Redis, etc.) — it's all in-process because Swoole workers persist. Obviously this only works for single-server deployments, but for many apps that's fine (or just replace the event bus with NATS).

Feedback welcome. Have you already used this pattern?

https://redd.it/1qklpup
@r_php
I built my own server dashboard using a Laravel health package API
https://redd.it/1qkskxo
@r_php
Is this naming convention any good? Asking for a friend...
https://redd.it/1qkvfg9
@r_php
A new simple library for reading EXIF data

I'm building an application that allows users to upload photos to it. I needed access to the EXIF data if available, so I assumed I could just use exif_read_data() and save the results as a JSON blob in the database.

Not so simple. I assumed EXIF data was just basic ASCII text, but I assumed wrong. Some values are byte arrays or enums that are encoded with NUL bytes and attempting to serialized them as JSON to be stored in at UTF-8 column failed.

Additionally, I didn't realize that coordinates weren't stored as floating point latitude, longitude pairs that we're familiar with. The EXIF standard doesn't support floating point numbers, so they're encoded as a list of strings that represent the degrees, minutes, and seconds as a fraction (and cardinal direction as a string).

Packagist showed a few existing EXIF libraries, but they looked like overkill for what I needed. So, like every PHP developer, I wrote yet another package named exif-tools.

It's dependency free (aside from the bcmath, ctype, and exif extensions) and handles a lot of headaches I ran into.

Check it out, I'd love to hear your feedback: https://github.com/1tomany/exif-tools

https://redd.it/1qkxgc8
@r_php
Replacement for Encryption-Bundle

In my old Symfony 5 projects, I used the michaeldegroot/doctrine-encrypt bundle to store encrypted data in the database. The bundle worked well and transparently. Now, the project needs to be updated to a current Symfony version, but the encryption bundle no longer works because it only supports ORM2.

Which encryption bundle is currently state-of-the-art for Symfony 7.4/8 and runs as smoothly as the encryption bundle?

https://redd.it/1qkvxjz
@r_php
Sharing our PHP libraries

Hey r/PHP,
We have been building and using our own PHP libraries internally for many years across various projects. Figured they might be useful to others.

We're calling them the "Perfect" collection (mainly because our main internal project was called PerfectApp). They're modern, and fully tested with 100% coverage.

After writing our own framework inspired by Laravel for in-house use we went the way of Symfony and made standalone library's that can be used in any modern project. Most of them were developed by real Engineers before the AI boom.

All public releases: https://packagist.org/packages/krubio/

https://redd.it/1qlc71s
@r_php
What's your opinion about routes that start with /index.php?

I've noticed that, when using the ServerSideUP fpm-nginx image with a Laravel project, adding /index.php before the path causes the page to render.

These Docker images are used by Laravel Cloud, so all projects hosted there work the same.

For example, for the Laravel docs page, these routes render the same content:

[https://laravel.com/docs/12.x](https://laravel.com/docs/12.x)
https://laravel.com/index.php/docs/12.x

The same occurs for the Laravel News blog:

[https://laravel-news.com/speeding-up-laravel-news-with-cloudflare](https://laravel-news.com/speeding-up-laravel-news-with-cloudflare)
https://laravel-news.com/index.php/speeding-up-laravel-news-with-cloudflare

I don't know if that's expected, but I personally would expect to remove the /index.php part or even return a 404 Not Found error if the path starts with /index.php because that route doesn't exist in the web.php file.

I’ve noticed this because Bing's index started indexing a bunch of URLs with the /index.php part.

https://redd.it/1qlth8e
@r_php
Looking for sample web projects (HTML, CSS, JS, PHP, Symfony, Bootstrap)

I’m a student currently learning full-stack web development and I’m looking for example projects built with HTML, CSS, JavaScript, PHP (Symfony) and Bootstrap.

If you have an old project, demo, GitHub repo, or practice project you don’t mind sharing, I’d really appreciate it. I’m using them only for learning and understanding structure, best practices, and architecture.

https://redd.it/1qqcsxi
@r_php
Best OAuth2 (client) bundle for establishing "clientcredentials" session

To integrate a third-party API with my application, I'll need to establish a session using the OAuth2 "client\
credentials" flow. The most popular packages appear to be the "knpu" or "benjaminfavre" bundles.

Based on the readme for each, the "benjaminfavre" bundle appears to be easier to implement, while the "knpu" bundle seems to be more flexible.

All things being equal, I'm leaning toward the "benjaminfavre" bundle, but would be curious to know if anyone has recommendations or concerns?



https://redd.it/1qqj5bj
@r_php
Laravel Live Japan – friendly, community-focused Laravel event in Tokyo 🇯🇵

Hey r/laravel

Josh here. 👋 If you don't know who I am, I work in DevRel at Laravel.

I’ll be heading to Laravel Live Japan in Tokyo this May, and I’m really hoping to meet and connect with folks from the Laravel community in Japan and anyone traveling in.

Laravel has such a huge community around the world, so I’m especially excited to see what people are building in Japan and across the wider APAC region.

If you’ve been to a Laravel Live before, the vibe is intentionally more intimate and community-driven than a massive conference. Lots of good conversations and time to actually meet people. I had the privilege of going to Laravel Live UK last year and it was truly one of my favorite times. I met so many incredible people.

Let me know if you’re coming or thinking about it! Happy to answer any questions.

laravellive.jp

https://redd.it/1qqi48a
@r_php
Secure the database credentials in Jaxon DbAdmin with Infisical

Hi,

I just published a blog post about how the credentials of the databases managed with Jaxon DbAdmin can be securely stored in the Infisical server.

I've used Infisical but any other secret management service can be used instead.

https://www.jaxon-php.org/blog/2026/01/secure-the-jaxon-dbadmin-database-credentials-with-infisical.html

https://redd.it/1qr7n3f
@r_php
Live walkthrough: Skills in Laravel Boost 2.0

Hey all!

I’m doing a live stream tomorrow (1/29) at 11 AM ET with Pushpak Chhajed on Laravel Boost 2.0.

We’ll be walking through:

* what changed in Boost 2.0 and why
* what Skills are and how they give LLMs better context in Laravel apps
* how Skills and guidelines work together in real workflows

If you have questions about Boost or the updates, feel free to drop them here ahead of time or ask in chat during the stream!

Stream link:
[https://www.youtube.com/watch?v=NWQjC20rWLg](https://www.youtube.com/watch?v=NWQjC20rWLg)


https://redd.it/1qpyil8
@r_php
Non AI things

Is there anything out there that isn't related to AI these days?

I have been building with Laravel and other tooling for 9 years but lately everything is related to AI.

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