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
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/1nbfvfb
@r_php
Automatic translations in Laravel apps... would you trust AI?

Don’t know about you. Tell me if it rings true:

Client: “We need it multi-language.”
Dev: “Are you sure? That means adding and editing content in all languages, every time.”
Client: “Yeah, yeah, no problem.”

Fast-forward 3 months… the app is a messy mix of half-translated content. Customers are confused, the brand looks sloppy.... everyone’s unhappy.



That’s been my experience with most multi-language apps. The tech part is easy (hello there spatie/laravel-translatable, backpack/crud, etc). The maintenance? Not so much. Admins get busy or lazy. Entries go untranslated.

So I asked myself: what if AI handled all of the translation… automatically? 👀 Imagine this: every time an admin creates or edits an entry, it gets translated by AI into 2, 5, even 10 languages. AI does the heavy lifting. No human bottleneck.

Turns out… it actually freakin' works! Like, really well! It took a lot of trial-and-error... been testing different models, prompts, chunking strategies for months — but the results are now surprisingly solid!

I've finished the two key features:
• backfilling missing translations in the DB;
• automatic translation whenever entries are added or updated;

Put together, you get:
• ZERO admin effort, when making an app multi-lingual;
• ZERO admin effort when adding / editing entries;
• Customers always see a properly translated app.

Don't believe me? Here’s a rough demo video, where I show it in action: https://www.loom.com/share/6a641c7e4e424070ab9ddbecd1edd637?sid=da3a39e8-ca92-4ccc-979f-79487815b14d



I’ve packaged this up and I’m rolling it out for 6 clients right now. But I’d love your feedback:

1. Would you trust AI to handle production translations automatically?

2. Would you/your clients pay for this — and if so, would you prefer a Composer package to hook up to your own model... or a hosted service?

3. Anything I'm missing here? Why isn't everybody doing this?

Appreciate your 2¢ 🙏

https://redd.it/1nbh4yj
@r_php
What are the best practices for optimizing PHP code to improve website speed and performance?



https://redd.it/1nbjgev
@r_php
Laravel react started kit, seems has changed, not sure when and what to do

inside every react component we used to call a web Route like this route(...)

but this time it seems things has changed

I have noticed a new folders

https://preview.redd.it/20cp2aym4znf1.png?width=297&format=png&auto=webp&s=cfb5db77b4e075b03677ad2125de6880e2e010a4

and here is a sample of a login route

https://preview.redd.it/texmr1tt4znf1.png?width=642&format=png&auto=webp&s=3010e80cc549d4a239f4f7a2a1b967db92a4f12f


what do you think of this approach, will it be good during scale,

and is there any docs for it, and what do we even name this approach



https://redd.it/1nbtqcz
@r_php
PhpStorm setup for Laravel

Hello everyone,

I am curious how you guys solve the code formatting throughout php, blade and js files.

I am trying to get a common ground between all developers and also enforce all code formatting rules via a github action.

I have tried many configurations, but none of them work in the same way for both CI and local, e.g. npx prettier output is different than the phpstorm auto format.

Also laravel pint (in ci env) is different than local format (in phpstorm).


If you have any suggestions or guides to fully setup phpstorm and a gituhub action, please feel free to drop it here :)


Thanks!

https://redd.it/1nbx9eg
@r_php
PHP Enum to javanoscript objects, The Ziggy / Wayfinder of Enums. Does that exists ?

In order to ensure consistency between front and back end, I'm looking for a package that would "automagically" generate javanoscript / typenoscript files from PHP enums.

I have loads of Enums that I am "mirroring" on the front-end for consistency. I would love this step to be automated.

Similar to what Ziggy ( https://github.com/tighten/ziggy ) or Wayfinder ( https://github.com/laravel/wayfinder ) do for routes: automatically generate some javanoscript code that can be used in the front-end.

Does that exist at all ?

How do you manage that in your code ?




https://redd.it/1nc0a6i
@r_php
The State of Laravel 2025 results are live!
https://stateoflaravel.com/

https://redd.it/1ncdu5w
@r_php
Question about PHP/FI

I am curious about the early PHP versions and I see no precompiled binaries for PHP/FI 1 or 2. Do these exist? if not, how can I build them from source?

https://redd.it/1ncvuix
@r_php
Laravel React native starter if any?

Do we have any Laravel React Native starter? Any recommendation?

https://redd.it/1nd6wc7
@r_php
Add a custom file in config/packages

I want to add a custom config file config/packages/job_offers.yaml. But i face an error:
In FileLoader.php line 177:

There is no extension able to load the configuration for "job_offer" (in "C:\Users\Asmitta\sources\phenix-emploi/config/packages/job_offer.
yaml"). Looked for namespace "job_offer", found "framework", "doctrine", "doctrine_migrations", "debug", "twig", "web_profiler", "stimulus"
, "turbo", "twig_extra", "security", "monolog", "maker", "doctrine_fixtures", "twig_component", "autocomplete", "dropzone", "asmitta_form_f
low", "live_component", "chartjs", "mercure", "a2lix_auto_form", "a2lix_translation_form", "doctrine_behaviors", "knp_paginator", "presta_s
itemap" in C:\Users\Asmitta\sources\phenix-emploi/config/packages/job_offer.yaml (which is being imported from "C:\Users\Asmitta\sources\ph
enix-emploi\src\Kernel.php").


In YamlFileLoader.php line 814:

There is no extension able to load the configuration for "job_offer" (in "C:\Users\Asmitta\sources\phenix-emploi/config/packages/job_offer.
yaml"). Looked for namespace "job_offer", found "framework", "doctrine", "doctrine_migrations", "debug", "twig", "web_profiler", "stimulus"
, "turbo", "twig_extra", "security", "monolog", "maker", "doctrine_fixtures", "twig_component", "autocomplete", "dropzone", "asmitta_form_f
low", "live_component", "chartjs", "mercure", "a2lix_auto_form", "a2lix_translation_form", "doctrine_behaviors", "knp_paginator", "presta_s
itemap".


I think it's because there's no package JobOffer, but how can i fix it please ? That config file is sent to one of my services.

https://redd.it/1nd8s9m
@r_php
will the forge 2 have a way to go around with mails?

hi, my setup is domains and mini-hosting by hostcreators, a small local company, then i have dns redirecting to digitalocean, because it's forge-connectable vps service.

now i have smtp at hostcreators, but they use ports 465 and 587, which are blocked by do.

so while paying for their mailing service, i also have to pay for mailgun.

since forge 2 vps' will be using do's servers, i assume these ports will still be blocked.

forge devs, is there a chance i could unblock these ports, so i don't have to pay 2 mailing subnoscriptions please?

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