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
Laisser la production en mode dev

Bonjour

Je fais ce post suite à un projet communautaire pour un serveur minecraft qui est une plateforme de vente d'objets en symfony.


Lors du passage en production (le premier de toute ma vie), j'ai eu de très nombreux problèmes notamment liés au mapping et au versioning des images.

Depuis, même après 6 heures de debug le problème est le suivant:

Si le projet est en mode dev, aucune erreur et les couleurs custom de tailwind sont bien appliquées.

si le projet est en mode prod, les images ne chargent plus et les couleurs de tailwind sont toutes remplacées par un bleu clair par défaut.

Quels sont les risques à laisser l'application en mode dev même pour les utilisateurs? Il n'y a aucune donnée sensible ni aucune manipulation d'argent, donc j'hésite vraiment à utiliser cette solution bien qu'elle relève de la facilité.

Je suis à l'écoute de vos solutions / avis

https://redd.it/1my4g7a
@r_php
Q: Import One Million Rows To The Database - 2?

Inspired by this video:
[https://www.youtube.com/watch?v=CAi4WEKOT4A](https://www.youtube.com/watch?v=CAi4WEKOT4A)

A *“friend of mine”* is working on a project that needs a robust solution for importing and syncing millions of rows across many users. The app is a marketing tool that syncs thousands of contacts from multiple external sources into a user’s address book. The system needs to:

* Fetch newly available contacts
* Update existing ones
* Remove contacts deleted from the original source

Ideally, all this should happen with minimal delay. The challenge grows as more users join, since the volume of operations increases significantly.

Right now, my *“friend”* is considering a recurring job to pull contacts and update them locally, but there are many open questions about scalability, efficiency, and best practices.

If you know of any resources, design patterns, or approaches that could help build an elegant and efficient solution, please share!

Thanks!

https://redd.it/1mya6cl
@r_php
Boosting Laravel Boost

Laravel dropped a new package "Laravel Boost". It makes AI suck less by giving it a bunch of tools to better understand your app, and it's great. But I think we can give it an extra boost.



https://blog.oussama-mater.tech/laravel-boost/

https://redd.it/1myb0d2
@r_php
Boosting Laravel Boost

Laravel dropped a new package "Laravel Boost". It makes AI suck less by giving it a bunch of tools to better understand your app, and it's great. But I think we can give it an extra boost.

https://blog.oussama-mater.tech/laravel-boost/

https://redd.it/1myb5s0
@r_php
New: Beam — Use Laravel Pennant Feature Flags in JS/React/Vue

Hey everyone! 👋

I just launched [Beam](https://beam.beacon-hq.dev), a small JavaScript + Laravel library that brings Laravel Pennant feature flags to your frontend (think: Laravel Echo but for Pennant).

Whether you’re building in React, Vue, or even vanilla JS, Beam gives you:

* Use your Pennant flags in the browser
* 🔁 A simple API to update your UI in real-time
* 🎯 Simple setup that feels Laravel-native

This isn’t a backend feature flagging tool — it’s purely for consuming Pennant flags from your frontend (works great with tools like Inertia too).

import { useFeatureFlag } from '@beacon-hq/beam/react';

function Component() {
const { status, value, loading } = useFeatureFlag<string>('experiment', {
defaultValue: 'control'
});

return (
<div>
{loading && <span>Loading…</span>}
{!loading && <div>{status ? `Variant: ${value}` : 'Feature Off'}</div>}
</div>
);
}

📦 Full docs & setup: [https://beam.beacon-hq.dev](https://beam.beacon-hq.dev)

It’s open source and in early beta — feedback welcome!

https://redd.it/1myjw4c
@r_php
Lost in the middle of frontend packages

I'm currently learning Symfony after years of working with Laminas. While the transition is relatively straightforward on the backend side, I'm completely lost on the frontend. Between Symfony UX/stimulus/hinclude.js/turbo/live components

I feel like I've come across a myriad of different frontend packages in the documentation without really understanding the specific purpose of each.

Do you use a lot of frontend packages in your Symfony projects? If so, which ones and why? And if you have any advice to better understand all this, I'd be happy to take it

https://redd.it/1myq0qm
@r_php
Type Safe Config Generator Implementation

Hi guys, so while reading the article Creating type-safe config classes : r/laravel by Luke Kuzmish posted yesterday, the comment here by u/sribb https://www.reddit.com/r/laravel/comments/1my1464/comment/na8uktj and a great deal of boredom, I decided to attempt to create a Type Safe Config Generator. Check out the implementation here (https://gist.github.com/Horlerdipo/d6350fe97b19754bb5bcee9c87739b14) and roast me (jk jk).
What do you think?
What would you do differently?

I plan to attempt adding type annotations for generated array types as PHPstan would start screaming at the classes that would be generated with this.

https://redd.it/1myv053
@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/1mz10v3
@r_php
Issue with Webhook Signature Verification when Request Body Contains Arabic Characters

Hello,
I’m implementing webhook signature verification for Loyverse in PHP. The verification works correctly when the request body contains only English characters.

However, when the payload includes Arabic characters, the generated signature does not match the X-Loyverse-Signature header, and the verification fails.

Here’s the relevant code snippet:

 protected function verifySignature($headers) {
$rawBody = filegetcontents('php://input');
if (empty($headers'X-Loyverse-Signature')) {
return false;
}
$signatureHeader = $headers'X-Loyverse-Signature';
$computedSignature = hashhmac('sha1', $rawBody, $this->appSecret);
return hash
equals($computedSignature, $signatureHeader);
}



Any help or pointers would be hugely appreciated

Docs https://developer.loyverse.com/docs/#section/Webhooks-overview/Adding-webhook

https://redd.it/1mz1v8f
@r_php
Why isn’t PHP more popular?

Hey, i'm a pretty new dev (generally and even more at php specifically). I've first worked with bare php for a web dev class at uni and thought the language was pretty cool, coming from C. Now I'm learning Symfony at work so i'm practicing the oop aspect of php, and it seems that this is a very powerful language?

Title is a bit clickbait as i know php is still very popular in backend, but i'm wondering why isn’t it more recommended as a general programming language? Like in software dev or game dev, where it seems Java and C++/C# dominate the industry

Am I missing something? (performance issues? or maybe i'm just not aware of the actual popularity of php?)

https://redd.it/1mz5ch5
@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/1mzfoxx
@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/1mzim12
@r_php
🚀 [Release] Free & Enhanced Fork of inertiajs-tables-laravel-query-builder

Hey everyone 👋,

I recently forked the `inertiajs-tables-laravel-query-builder` package by Pascal Baljet. As some of you may know, the original project has been discontinued in favor of a paid version.
Rather than letting it fade away, I decided to maintain it and extend it with several new features.

# What’s New in my fork

* **Fluent API**: brand-new, intuitive API for configuring tables
* **CSV Export**: export filtered data straight to CSV
* **Custom Export Callbacks**: easily hook into the export process (Excel, JSON, XML, or any custom format)
* **Number Filters**: advanced numeric filtering with multiple comparison operators
* **Column Filters**: filter icons directly in column headers for quick access
* **Resizable Columns**: drag to resize table columns
* **Customizable Header & Cell Classes**: apply custom classes per column header or cell for styling flexibility

# Still Included (from the original)

* Auto-fill (`thead`/`tbody` auto-generation with custom cell support)
* Global search & per-field search
* Select filters
* Toggle columns
* Column sorting
* Pagination (Eloquent / API Resource / Simple / Cursor)
* Multiple tables in a single view
* Automatic query string updates (via Inertia replace)

So everything that made the original package great is still there — but now extended with a more modern and flexible API, plus export support and new customization options.

👉 [https://github.com/adesin-fr/inertiajs-tables-laravel-query-builder/](https://github.com/adesin-fr/inertiajs-tables-laravel-query-builder/)

Would love feedback, issues, or PRs from the community 🙌

https://redd.it/1mzjyxr
@r_php
Is PHP Finally Shedding Its “Legacy” Label in 2025?

For years, PHP has carried the “old and messy” reputation compared to modern languages like Node.js, Go, or Python. But with PHP 8+ introducing JIT, Fibers, attributes, union types, and significant performance boosts, many developers are starting to see it in a new light.

Big players like WordPress, Drupal, and Laravel still power massive portions of the web, and new frameworks are pushing PHP into areas beyond traditional CMS use. Some benchmarks even show PHP 8.3 competing closely with Node in performance-heavy workloads.

Do you think PHP has finally shaken off its “legacy” stigma? Or will the perception always linger, no matter how much the language evolves?

https://redd.it/1mzmqxj
@r_php
How I can inject extra logic queries on doctrine's schema:update

I want once I run:

php bin/console list doctrine:schema:update


Once an SQL query is generated, before printing it to generate extra SQL based on the already generated SQL. I am a situation in which the team work upon does not use db migrations (reasons uknown, no time to explain why)

I am into a situation in which I introduce upon entity a new column that is not null and unique:


I originally have this entity

declare(strict_types=1);

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;

#[ORM\Entity]
class Coupon
{
public const PREFIX = 'cou';
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;

#[ORM\Column(type: 'string', nullable: true)]
private $name;

public function __construct()
{
}

}


And the underlying table has already soem records:


id | name
--- | ---
1 | hello
2 | value

And I want to introduce a unique not null column named token:


declare(strict_types=1);

namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;

#[ORM\Entity]
class Coupon
{
public const PREFIX = 'cou';
#[ORM\Id]
#[ORM\Column(type: 'integer')]
#[ORM\GeneratedValue(strategy: 'AUTO')]
private $id;

#[ORM\Column(type: 'string', length: 255, unique: true)]
private string $token;

#[ORM\Column(type: 'string', nullable: true)]
private $name;

public function __construct()
{
}

}



But this need to be populated with a unique value before doctrine:schema:update generates the inique index.

Furthermore ci/cd pipeline that deploys it runs this command that updates the db:

php bin/console list doctrine:schema:update


Therefore I want this procedure to be automated. How can this be done? Is there a way to inject logic on doctrine:schema:update that generate extra sql on situations like this one?

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