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
Dilemma: Release my own package or contribute to someone else?

I recently added http logging to my Laravel project, for both incoming and outgoing requests. My reasons were for enhanced security, historical data, and retaining paid API responses such as those from Google APIs. I also made it configurable to include removing sensitive data, ignore certain URLs, pruning, automatic uploads of files, database logging option, etc. I was just about to turn this into a package for release when I found that someone else just recently released a similar package. Their package doesn't do everything mine does, and vice versa, but I don't know if I should release my version or just contribute my ideas to theirs. What is the normal consensus here? I know there are many packages out there that do similar things, but I also don't want to step all over someone else's work.

https://redd.it/1ngprq9
@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/1ngwl0i
@r_php
Feedback needed: Stream Pulse Event Streaming & Monitoring Tool (MVP with Redis Streams)

Hey everyone

I’m working on a side project called Stream Pulse a lightweight tool to help developers manage event-driven workflows. The idea is to support multiple backends in the future, but for the MVP (v1) I’m starting with Redis Streams.

What it does so far:
• Uses Redis Streams to handle events.
• UI to monitor streams (consumer lag, event list).
• Configurable retention (how long to keep events).
• DLQ (Dead Letter Queue) for failed events, with retry support.

What I need your help with:
• As Laravel devs, do you find this useful for real projects?
• What features would you want to see in v1 or v2 (e.g. metrics, alerting, integrations)?
• Would you prefer this as a standalone monitoring tool or a package you can drop into Laravel projects?

My goal is to make event handling + monitoring developer-friendly without needing to jump into Kafka/RabbitMQ complexity unless really needed.

Would love to hear your thoughts

https://redd.it/1ngwy63
@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/1nhazyz
@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/1nhdypj
@r_php
Mysql connection problems, there are too many!

So I am running a site with decent traffic, not sure how many, but maybe 100 - 200 users, possibly up to 1000. I am connecting to a remote mysql database with a limit of 1400 connections.

I configured php-fpm to this:

>pm = dynamic
pm.max_children = 200
pm.start_servers = 10
pm.min_spare_servers = 10
pm.max_spare_servers = 190
pm.max_spawn_rate = 32

When running ps -ef | grep php-fpm I got 31 processes. Somehow through, they generate more than 1400 mysql connections! I set PDO::ATTR_PERSISTENT => true to the PDO instance:

$db = new PDO('mysql:host=' . DBHOST .
    ';dbname=' . DB
NAME . ';charset=UTF8', DBUSER, DBPASS,
    PDO::ATTR_PERSISTENT => true
);
$db->setAttribute(PDO::ATTRERRMODE, PDO::ERRMODEEXCEPTION);
$db = new PDO('mysql:host=' . DBHOST .
    ';dbname=' . DB
NAME . ';charset=UTF8', DBUSER, DBPASS,
    PDO::ATTR_PERSISTENT => true
);
$db->setAttribute(PDO::ATTRERRMODE, PDO::ERRMODEEXCEPTION);

I also have an Illuminate capsule instance called by this noscript:

// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())
$capsule->bootEloquent();

<?php
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;

requireonce 'vendor/autoload.php';

$capsule = new Capsule;

$capsule->addConnection([
    'driver'    => 'mysql',
    'host'      => DB
HOST,
    'database'  => DBNAME,
    'username'  => DB
USER,
    'password'  => DBPASS,
    'charset'   => 'utf8mb4',
    'collation' => 'utf8mb4
unicodeci',
    'prefix'    => '',
    'options' => [
        PDO::ATTR
PERSISTENT => true // Enable persistent connections
    ]
]);

// Set the event dispatcher used by Eloquent models... (optional)
$capsule->setEventDispatcher(new Dispatcher(new Container));

// Make this Capsule instance available globally via static methods... (optional)
$capsule->setAsGlobal();

// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())
$capsule->bootEloquent();


<?php
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;

requireonce 'vendor/autoload.php';

$capsule = new Capsule;

$capsule->addConnection([
    'driver'    => 'mysql',
    'host'      => DB
HOST,
    'database'  => DBNAME,
    'username'  => DB
USER,
    'password'  => DBPASS,
    'charset'   => 'utf8mb4',
    'collation' => 'utf8mb4
unicodeci',
    'prefix'    => '',
    'options' => [
        PDO::ATTR
PERSISTENT => true // Enable persistent connections
    ]
]);

// Set the event dispatcher used by Eloquent models... (optional)
$capsule->setEventDispatcher(new Dispatcher(new Container));

// Make this Capsule instance available globally via static methods... (optional)
$capsule->setAsGlobal();

Essentially, I run this noscript every time I access a PHP noscript. So I have two connections, one "raw" PDO and one Illuminate Capsule. What might be the problem?

I am trying to think of how to solve this, I need to throttle the connections. Implement a pool or something. I am quite limited on options since my server only have 2GB ram.

https://redd.it/1nhh9cg
@r_php
I turned FilamentPHP into a no-code app, sort of

Hi,

I want to start by saying that I enjoy using FilamentPHP, have been working with it since v2, on various projects, and now it is my go-to tool when creating anything admin panel-related.

With that being said, you still have to code stuff, so I thought, what if I could make FilamentPHP work as a no-code tool?

So I did that, sort of. Well, I did mostly a demo, you can basically create TextInput, Selects, and define one-to-one and one-to-many relationships.

Now to share some technical details. The whole project runs on SQLite (I was inspired by PocketBase and the idea of having a lightweight, standalone, independent tool that doesn't need any other resources running to use it other than the web server itself). In order to make this thing work alongside Laravel and FilamentPHP I created a GenericModel class to talk with the database, custom migrations for database relationships as well as a somewhat easy-to-extend builder for forms and tables.

The project is of course very early, there is stuff that works on the surface, but if you look behind the scenes is not good code, there is no docs, no way to extend anything other than modifying the core.

Long story short, if you are curious, want to share any feedback, or anything really here is a link to the repo https://github.com/morfibase/morfibase

https://redd.it/1nhq1ap
@r_php
PHP (Non Thread Safe) now on WinGet

As I use PHP for general Windows noscripting tasks I was happy to see the (faster) NTS version added to the WinGet package manager only a few days after a post I made to the PHP mailing list. I'm impressed.

https://redd.it/1nies7m
@r_php
How much AI assistance do you use when working on Laravel projects?

This is something I've been wondering about for a while in the greater Laravel community. For me personally, I tend to only use Copilot inside PHPStorm as mostly a glorified autocomplete when it comes to creating files.

If I'm stuck on a particular method or completing a test assertion, it can come in handy, but I don't let it have free rein over dictating what my code is or should do, as that tends to lead to readability issues and undesired outcomes in my experience.

I imagine there are two camps: no AI or only uses AI and with lots of nuance in between.


How much AI do you use in projects and what do you use? I know AI can be such a hot topic but I'm curious to see what people's thoughts are specifically within the Laravel world.

https://redd.it/1niekdh
@r_php
Longhorn PHP full schedule

Hey y'all - just wanted to share that the full schedule is now online for this year's Longhorn PHP:

https://longhornphp.com/

The conference is October 23-25 in Austin, TX. We have virtual ($75) and in-person ($250-$350) ticket options.

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