PHP Reddit – Telegram
PHP Reddit
34 subscribers
291 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
Anyone using Laravel Octane with FrankenPHP on production?

So we are evaluating production deployments for our distributed system and at the moment are considering serversideup nginx images or FrankenPHP. Our systems has to handle traffic from on average 5-10k IoT devices per cluster. It's a distributed micro-service system. We haven't done any benchmark at our end for both and serversideup images are our fallback option; So wondering if anyone has been running FrankenPHP in production and has there been any issues or so?

https://redd.it/1m15i3a
@r_php
Messenger retry without config permission in Rabbit

As the noscript says, I need to configure retry without access to creating new queues (I can still create them manually in the dashboard).

Is there a way to implement retries on predefined queues? Or maybe there is another solution that I haven't considered?

Symfony 7.3

https://redd.it/1m16f9j
@r_php
TrueAsync Chronicles

Hi everyone,

A lot has happened since the first announcement of the TrueAsync RFC. And now, with the first alpha release of the extension out and the official RFC for core changes published, it’s a good moment to share an update.

Why hasn’t the current RFC been put up for a vote yet?
Digging through documents from other programming languages, forum posts, and working group notes, it became clear that no language has managed to design a good async API on the first try.

It’s not just about complexity—it’s that solutions which seem good initially often don’t hold up in practice.

Even if a single person made the final decision, the first attempt would likely have serious flaws. It’s a bit like Fred Brooks’ idea in The Mythical Man-Month: “Build one to throw away.” So I’ve concluded that trying to rush an RFC — even “fast enough” — would be a mistake, even if we had five or seven top-level experts available.

So what’s the plan?
Here the PHP community (huge thanks to everyone involved!) and the PHP core team came through with a better idea: releasing an experimental version is far preferable to aiming for a fully polished RFC up front. The strategy now is:

1. Allow people to try async in PHP under experimental status.
2. Once enough experience is gathered, finalize the RFC.

Development has split into two repos: https://github.com/true-async:

1. PHP itself and the low-level engine API.
2. A separate extension that implements this API.

This split lets PHP’s core evolve independently from specific functions like spawn/await. That’s great news because it enables progress even before the RFC spec is locked in.

As a result, there’s now a separate RFC focused just on core engine changes: https://wiki.php.net/rfc/true\_async\_engine\_api

If the proposed API code is accepted in full, PHP 8.5 would include all the features currently found in the TrueAsync extension. But in the meantime, you can try it out in Docker: https://github.com/true-async/php-async/blob/main/Dockerfile

I firmly believe that early access to new features is a crucial design tool in software engineering. So a prebuilt Windows binary will be available soon (it basically exists already but needs some polishing!).

What’s under the hood of the TrueAsync extension?
TrueAsync ext uses LibUV 1.44+ and PHP fibers (via C code) to implement coroutines.

Fibers enable transparent async support without breaking existing code. You can call spawn literally anywhere — even inside register_shutdown_function() (although that’s arguably risky!). Meanwhile, regular functions keep working unchanged. In other words: no colored functions.

The scheduler algorithm has been completely redesigned to halve the number of context switches. Coroutines can “jump” directly into any other coroutine from virtually any place — even deep inside C code. You can break the execution flow however and whenever you want, and resume under any conditions you choose. This is exactly what adapted C functions like sleep() do: when you call sleep(), you’re implicitly switching your coroutine to another one.

Of course, the TrueAsync extension also lets you do this explicitly with the Async\suspend() function.

The current list of adapted PHP functions that perform context switches is available here:
https://github.com/true-async/php-async?tab=readme-ov-file#adapted-php-functions

It’s already quite enough to build plenty of useful things. This even includes functions like ob_start(), which correctly handle coroutine switching and can safely collect output from different functions concurrently.

And you can try all of this out today. :)

https://redd.it/1m18m4c
@r_php
Short function

A new RFC about short function (here called Single-Expression functions) is currently in voting phase : https://wiki.php.net/rfc/single-expression-functions

About 5 years ago another RFC about the same syntax has been declined : https://wiki.php.net/rfc/short-functions

And the result is really mixed (from the previous RFC, the no is only sligthly ahead).

So, what do you think about this RFC, and change that can make PHP slightly less verbose, without introducing real features ?

Does complexifying the syntax is worth it if it can reduce the code size / give a more pleasant UX ?

https://redd.it/1m1bfad
@r_php
Zend PHP Certification Exam & Other Certifications Advice

Hello everybody, so I've been using PHP for six years, but I have no Bachelor's Degree or certifications outside of PHP Basics from W3 Schools. How I got my much, I have no idea, but I do good work and they like me. However, I'm trying to get some certs under my belt so perhaps I could find a higher paying position and be a better developer. My boss has agreed to purchase me the Zend PHP Certification Exam as he feels we could advertise the certification on the company website. I'm thrilled to add this to my resume and have begun studying. The resource I'm using is this.


https://github.com/ivantusek/Zend-PHP-Certification


It appears to be well done and legitimate and I'm making flashcards of all the questions so I can really study as well as for the few examples I don't understand, playing around with them on my local host until I have a thorough understanding. Is this enough? I would be so embarrassed to fail this exam on my bosses dime and then have to pay for it on my own and I don't want to ruin the chance for my boss to pay for more certifications (would like one in PHP Security). Any suggestions on how I can guarantee I pass the exam with flying colors? Hoping to take it at the end of August.

https://redd.it/1m1ecym
@r_php
Boost Your Productivity: PHP DataGrid with AI Assistant!

Hey devs! I just launched a new feature on GridPHP — an AI-powered assistant built right into the PHP DataGrid.

It helps you:

Get instant summaries and reports from your DataGrid

Ask complex queries and receive smart insights

Automate analysis without writing complex SQL queries

Provide smart suggestions for better data analysis

No complex setup — just plug it in and start working smarter.

Would love feedback from the community! 🙌
Check it out: https://www.gridphp.com/datagrid-ai-assistant/

https://redd.it/1m1w9l3
@r_php
Does Laravel Nightwatch not show custom data from the context API?

Am I crazy, or is that custom data not available in Nightwatch? Seems like a big oversight if true, being a first party framework feature.

https://redd.it/1m23iew
@r_php
Open Source Clueless – Built a desktop AI meeting assistant using Laravel + NativePHP

Hey Laravel devs,

Just wanted to share something I hacked together over the last week — Clueless, a desktop AI meeting assistant built with Laravel 12, NativePHP, and Vue.

Yes, it runs as a native desktop app using Electron via NativePHP.

# 🧠 What it does (quickly):

Transcribes meetings in real time
Analyzes and provides meeting insights in real time.
Pulls out key moments like pricing, follow-ups, and decisions
Writes email drafts when you say you'll follow up

It uses SQLite for storing conversation data and is built with privacy in mind. Minimal by design.

# 🔧 Tech Stack:

Backend: Laravel 12 (PHP 8.2+)
Frontend: Vue 3.5.13 + TypeScript + Inertia.js
Desktop: NativePHP + Electron
Styling: Tailwind CSS 4.1.1
Database: SQLite for local conversation storage
Build Tool: Vite 6

NativePHP made it simple to extend a full Laravel stack into a desktop app context.

📂 Repo: https://github.com/vijaythecoder/clueless ⭐️ Star it if you’re curious — happy to answer any questions!

https://redd.it/1m268x0
@r_php
Migrating from a legacy application and database

I am yet another old php developer looking at migrating a legacy application (internally developed framework) to Symfony.
I have found a bunch of threads on the topic but not much resolution and they were all fairly out of date. So I am hoping there is some more modern option.

The situation I have is I have an old application with hundreds of established database tables. They are well structured and have outside analytics tools that reference them. So I cannot change them.
Is there any way to get Symfony with one of the ORMs to be able to automatically generate the needed entity entries. I know there used to be doctrine:mapping:import but it looks like that was removed.

The additional tricky bit is that it is a commercial database (Informix) that is not natively supported by doctrine, though I did find an old github project that looks like it set up most of the mappings for it.

I am very open to any advice or just finding out if I am kind of out of luck without a lot of manual work.

https://redd.it/1m28nh2
@r_php
advice on developing PHP architecture skills

I have been developing small plugins for Wordpress and it has been ok building small plugins that do a couple of task. But my desire is to build bigger more complex plugins.

* So I started by watching Alecadd plugin tutorial on Youtube, this was good introduction,
* Then I read the Wordpress plugin handbook, which gives ideas in what to do but is not a tutorial
* Then I download several plugins and started studying code, but each plugin is different and there is not comments explaining architecture decision

My goal is to build very efficient plugins, but learning good architecture is hard, all tutorials I know don't teach architecture, just syntax and concepts. Can the community help? Any advice. Thank you

https://redd.it/1m2efl0
@r_php
I made an open source shell to enrich Laravel Tinker

If you’ve ever dove headfirst into a production server at 2 a.m., opened up **Laravel  Tinker**, pasted a half‑forgotten piece of code from Slack just to fix a client’s data… you know the pain that introduced this project:

* **Copy‑paste roulette:** I maintained a personal graveyard of "maintenance noscripts" spread all over notes, Gists, and chat histories. Whenever something was broken, I searched for the appropriate one, adjusted a variable, hoped I didn't fat‑finger anything, and pressed enter.
* **Zero visibility:** I’d shoot off another throw-away fragment after patching to verify the system was *actually* healthy. It was impossible to find a single location to review *all* the relevant checks before and after executing code.
* **Production paranoia:** Tinker is powerful, but one wrong command can mangle live data. There’s no guard‑rail, no categorisation, no history you can audit later.

I soon came to my senses: *this workflow is a liability*, not a tool. I needed something custom‑built.

What if there were:

1. A **dedicated shell** that bootstraps the complete Laravel context.
2. A first‑class **noscript repository**: version‑controlled, discoverable, grouped by domain
3. **System checks** that can be executed before or after a noscript, with one command, and which return a definite OK/FAIL report.
4. **Safe mode** that refuses to do anything reckless when `APP_ENV=production`—unless you explicitly allow it.

That idea became **NodiShell**

# What NodiShell really solves

|Issue|How NodiShell resolves it|
|:-|:-|
|Scripts spread throughout chat, Gists, sticky notes|**Category‑based repository** (`app/Console/NodiShell/Scripts`) with autocomplete searching|
|Manual copy‑paste into Tinker|**Interactive menu** – arrow‑key navigation, fuzzy search, one‑hit execution|
|No repeatable health checks|**Pluggable system checks** (DB, cache, queues, your own) with colour‑coded results|
|Risky production changes|**Built‑in safety layer** (`--safe-mode`, `isProductionSafe()`) and confirm prompts|
|Losing context between noscripts|**Session-wide variable store** injected directly into Tinker|

That is, Tinker **with discipline**.

# Under the hood

* **Laravel native** – install with `composer require nodilabs/nodishell`.
* **Generator commands** – `php artisan nodishell:noscript` scaffolds a skeleton with type hints, docblocks, and error‑handling baked in.
* **Customisable UI** – emoji icons, colour themes and sort order so your ops team actually enjoys using it.
* **Autodiscovery** – put a PHP class somewhere under the `Scripts`, `Categories` or `Checks` dir, NodiShell finds it automatically, without service‑provider contortions.

# A 30-second Example

# run a one‑off repair
php artisan nodishell --noscript=reset-user-password

# or open the menu
php artisan nodishell

Select **“Maintenance → Reset User Password”**, enter the user’s email, and NodiShell fires the noscript, shows a success banner and leaves the result in `$lastResult`—ready for inspection in Tinker.

# Try it

composer require nodilabs/nodishell
php artisan vendor:publish --provider="NodiLabs\NodiShell\NodiShellServiceProvider"
php artisan nodishell

Five minutes and your first maintenance noscript will be executing & no more copy‑paste anxiety. Test it, feedbacks and PRs are always welcome!

Repository link: [https://github.com/nodilabs/nodishell](https://github.com/nodilabs/nodishell)

https://redd.it/1m2fjip
@r_php
Why did Laravel make translations file-based by default

Hi,

I've been programming Laravel for 5 years - I program a bilingual app, but I'm in America and our customers are in France -

I'm still learning a lot, but one thing that has been a nightmare for our project is translations -

Right now, we have a Caffeinated based module system, with a Lang folder for each module, along with en and fr for translations. I know that Caffeinated is outdated, but Nwidart apparently has a similar problem -

Apparently in Laravel, translations are taken from files by default, and there is no out of the box system for managing localization in the Database. Maybe I missed something... but when I use trans or __(), it seems like it is directly going to the file system.

This means that translations have now become a part of the source code... which I guess it makes sense, because it's the developers who come with new ideas for views, widgets, alerts, etc - which require new messages but it puts the responsibility on us to manage translations, since translations now have to be tracked by Git.

I'm not sure how much easier translations would be with a Database one or if that is even possible... but it seems like pushing this issue to git seems like it creates an unnecessary problem. It seems like having an easy way to export and import translations via the Database would be the easiest thing.

I'm a sole developer so it's not that bad, but every time my boss needs to make production specific changes to different servers running the same app... it's like you missed this translation, you missed that translation, etc.

On top of that with Docker, deployments don't even preserve changes made by users to those translation files. So now we have mutability in the file system -

So I'm just wondering if I'm missing something, how others solve this problem, how Laravel intended this problem to be addressed. I know there are libraries that handle localization for models - but not so much for features and structural parts of the app.

https://redd.it/1m2esah
@r_php
"clone with" functionality is coming to PHP 8.5!
https://wiki.php.net/rfc/clone_with_v2

https://redd.it/1m2ufsl
@r_php
I used create instead of updateOrCreate in a job that was updating a report every 30 mins
https://redd.it/1m2wwze
@r_php
Global objects

In practice, how do you implement global objects/services that should be available at any part of the web (Logger, Session, CurrentUser, Database, etc.)? DIC, manual injection into all classes, global functions, access via global keyword, ... ?

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