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
Longhorn PHP is returning this fall - CFP open now!

Hey y'all - after skipping last year due to overlap with Laracon, we are bringing back Longhorn PHP for 2025. The CFP is open now, so please submit some talks! Key details:


When: October 23-25, 2025
Where: Austin,TX - Holiday Inn Austin Midtown
Website: https://www.longhornphp.com
CFP: https://cfp.longhornphp.com

https://redd.it/1lkablk
@r_php
SaaS with PHP: Libraries or Roll Your Own Multi-Tenancy?

While writing my recent newsletter release on multi-tenancy, I've started to think about in-house vs external library approaches for the tenant data isolation.

Most of the SaaS companies I worked with, or discussed the architecture with, had an in-house implementation, or they had none. By none, I mean the software they write is just single-tenant, and they spin up a fresh instance for each customer. That works for some business cases, for some it does not, but that is a different topic to discuss.

Back to in-house vs library. Currently, there are some good, ready-to-use solutions, such as Laravel Tenancy, which seem to cover most of the required flows, battle-proven, and easy to set up. On the other hand, when you know the approach you would like to have, writing your own implementation will take less than a day, or a couple of days in more complicated scenarios. In exchange, you get full control of how the multi-tenancy behaves, and both altering it to your needs as well as debugging should be easier. And the SaaS companies I talked with - each of them needed some very specific solutions perfectly tailored to their case.

What is your preference? I guess, when building the MVP, a ready-to-use solution seems a better choice, as long as the approach allows you to switch/extend it in the future. Each day saved might be crucial. In other cases, I prefer to implement my own solutions. in case you are interested in the newsletter edition on this topic: https://phpatscale.substack.com/p/php-at-scale-10 



https://redd.it/1lkttfj
@r_php
Trouble Logging from Laravel (Local) to Remote Elasticsearch on AWS – Any Tips?

Hey everyone!

I'm working on a Laravel project locally and for a test trying to send application logs to a **remote Elasticsearch cluster hosted on AWS**.

The idea is to centralize logs for auditability, and I'm using **Monolog** to push logs to a specific index.

# What I’ve done so far:

* Set up Laravel to use a custom Monolog handler with the `elasticsearch/elasticsearch` PHP client.
* Created a dedicated index (`custom-output-index-001`) on the remote host.
* Verified I can connect to the AWS host using cURL and basic auth.
* Confirmed the logs are being written *locally* if I point to a local Elasticsearch instance (`localhost:9200`).

# The problem:

When I switch the Elasticsearch host in the Laravel config to the remote endpoint (on AWS), **no logs show up in the remote index**, and I get **no exceptions or errors** in the Laravel logs.

# What I suspect:

* The client version (v9.x) may not be compatible with the remote ElasticSearch instance. I’m considering downgrading to the v7.x client which uses `application/json` instead of `application/x-ndjson`.
* Content-Type mismatch? The remote service may reject the format used by the newer client.
* Maybe a network/firewall/SIGv4 auth issue?
* Or the index mapping/settings on AWS Elasticsearch need to be adjusted to accept those documents?

# What I’d like to know:

* Has anyone successfully configured Laravel to log to a remote Elasticsearch endpoint?
* Did you have to downgrade the client library or tweak headers?
* Any best practices or gotchas when working with Elasticserach + Laravel?

This is myy current logging config

use Elastic\Elasticsearch\ClientBuilder;
use Elastic\Elasticsearch\Exception\AuthenticationException;
use Illuminate\Support\Facades\Log;
use Monolog\Logger;
use Monolog\Handler\ElasticsearchHandler;
use Monolog\Formatter\ElasticsearchFormatter;

class ElasticsearchLogger
{
/**
* @throws AuthenticationException
*/
public function __invoke(array $config): Logger
{
$client = ClientBuilder::create()
->setHosts([
[
'host' => MY_HOST,
'port' => ENV_PORT,
'scheme' => ENV_SCHEME,
'user' => '********', // ← Basic Auth username
'pass' => '*****', // ← Basic Auth password
]
])
->build();

$indexName = 'custom-output-index-001';

$handler = new ElasticsearchHandler($client, [
'index' => $indexName,
'type' => '_doc',
]);
$response = $client->info();
Log::debug("CLIENT",[$response]);

$formatter = new ElasticsearchFormatter($indexName, '_doc');
$handler->setFormatter($formatter);

return new Logger('elastic', [$handler]);
}
}

Thanks in advance!

https://redd.it/1lkwi22
@r_php
New to php, but curious about it with Laravel

Hi guys,

I've been lurking some time now, and I want to try out php with Laravel.
Which editor do you guys recommend for php development?
Also any extensions that are useful?

Cheers!

https://redd.it/1llb32w
@r_php
what are the quirks of php and what mindset should a php dev have ??

forgive if my words come out wrong and ill-informed

was told php is not an important language ,now have to work on it cuz I was a java dev. now i have to work in my hometown due to ma and pa so i have taken a php job

what makes a php dev great compared to say a java dev or c++ dev?? hidden quirks of the language and mindset

https://redd.it/1lloch0
@r_php
Tempest 1.0 is now released: a new framework for PHP web and application development embracing modern PHP
https://tempestphp.com/blog/tempest-1

https://redd.it/1llpaoa
@r_php
Job search realities

Recently started job searching. Where I work is great, but there's no room for growth. After 2 months of applying all over the place, I haven’t landed a single interview.

The pickings are slim unless you’re a Senior with a god-tier toolkit or a Junior willing to sell your soul for pennies on the dollar. Is it AI? Is it cheap outsourcing? I don’t fucking know lol. All I know is, at this rate, I’m gonna be stuck in the same role for years 😭😭😭

Anyone else got it worse?

https://redd.it/1llr3fn
@r_php
Looking for a php dev

Hello building a website based off of a template I have I would like a php dev that I can either pay for the project or pay per hour to change and make the template to my liking/needs. Feel free to message me your portfolio and rates please only message me if you speak perfect English I can’t deal with language barriers will be ignored if you ignore this thank you!

https://redd.it/1llyz6g
@r_php
TIL Trump Mobile (Donald Trump's new carrier service) has a website that is built with Laravel, Livewire and Filament.

As I'm sure you've heard, Trump Mobile is a thing now and I decided to check out their website earlier.

Other than the amusing 500 errors when you try to reset an account email that doesn't exist, and the multitude of errors from YouTuber's that have tested out the platform with an account.

I found out that Trump Mobile clearly uses Filament by navigating to the admin url (https://www.trumpmobile.com/admin) and has livewire stuff happening on the main site as well.

This isn't meant to be political, I just found it amusing that the site clearly uses Laravel and how clunky and untested the website is.

https://redd.it/1lm0i0h
@r_php
What's your favorite PHP feature?

For me I really love reflection. I recently had to use the reflection api to handle serializing custom pre <php7 class-based enums as well as new native php8 enums at the same time, the reflection api (and *BackedEnum* interface) made this a breeze. I can see how you could make some really powerful frameworks with how powerful reflection is and it only makes me wonder why it isn't a staple of every language.

https://redd.it/1lm0qhc
@r_php
Casually achieving 600 req/s with a very simple PHP only WLP theme (PHP Swoole with Mostly Wordpress Compatible)

It seems PHP Swoole really takes PHP to the next level. This is even with some database calls. I can't post an image here, but for more info see r/WhitelabelPress

https://redd.it/1lm2v0a
@r_php
How much do we really need many tools we use ?

Hello,

I'm PHP developer since 2009. I worked on websites and pure backend. Always with heavy traffic and volumetry of data to manage.

Here a list of framework/tools/library I used:
- Symfony framework with some component (Cache, Serializer, HttpClient, Messenger)
- API Plateform
- Doctrine ORM
- React Admin

All of them seems great but... Do I/we really need them ? Are we using them because we need them or because:
- they were here before us in our current job ?
- we don't know how to do without them ?
- some people in events said it was great so it should be true ?
- we didn't master the basics so we try to dodge our weakness ?

At my job, we removed Api Plateform. Because it is not so difficult and it does not take so much time to implement our endpoints with Symfony 7. Less configuration to maintains, less magic code executed, less bugs from space, less time lost.

We also replaced Doctrine ORM by Doctrine DBAL. We write directly our request in SQL. More convenient to read, debug, check performance issue (EXPLAIN, EXPLAIN ANALYSE with pgsql). Entities are hydrated manually. Yes it take a little time to write the code which hydrate ann entity from a PHP array, but less configuration, less magic bugs, less over generic code managing all possible cases we don't have. We directly know what exactly is happening, better performance.

Do you really feel something similar ?

https://redd.it/1lm4tai
@r_php
I wanted to share a project I've been working on

I created it to solve a common problem: processing large datasets (gigs of CSV, JSON, etc.) in a language like PHP without the noscript crashing due to memory exhaustion. The solution was to build the entire processing pipeline around PHP's Generators, which allows data to be handled one record at a time in a streaming fashion.

I was heavily inspired by the fluent and expressive syntax of libraries like .NET's LINQ and Laravel's Collections, so I focused on making the API as clean and readable as possible.

I any of you are interested here is the link to the repo:

https://github.com/zepzeper/torol

https://redd.it/1lmkdpl
@r_php
I build a Flexible Business Application System in Symfony

I just want to bring your attention to one of my work👇

PrestoFox is a Flexible Business Application System that has collection of components that is need for build an application of any complexity.

It has built its multi-tenant architecture. Using PrestoFox one can build any kind of app like PWA, Web App, iOS app, Android app, desktop app, or browser plugin using a single code base.

It has components like custom fields, workflows, authentication, multi-tenancy, configuration system, reports, dashboard, permission system , import and export , attachment, data audit logs, pick list management, data grids and filters, search, GraphQL API, security, API call rate limiting , notifications, queue System, job scheduling, background job logging, data fixtures, data populators, translations, component health check end points, data validations etc.

This components work together in PrestoFox to make the strong foundation for the application that gets built on top of it. All these components make use of MIT Licensed Open Source solutions like Symfony , Vue JS , PostgreSQL etc


I have already built 5+ SaaS Products and 3+ internal business applications using it.

I am happy to answer any questions.

https://redd.it/1lmnf58
@r_php
What should I expect in a 2-hour Symfony Backend Engineer technical interview?

Hey folks,

I have a 2-hour technical interview coming up with a CTO for a Symfony Backend Engineer position. It's a senior-level role, and I’d love to hear from anyone who's had similar long-format interviews.

What should I expect during these 2 hours?

Do they usually focus on deep architectural questions?
Is live coding involved?
How much of it is about Symfony core (like services, events, voters, Messenger)?
Do they dive into Doctrine internals or real project debugging?

Also:

How can I best prepare to make the most of the time?
Any questions I should ask them at the end?

Appreciate any tips, experiences, or resources 🙌

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