PHP Reddit – Telegram
PHP Reddit
34 subscribers
294 photos
39 videos
25K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
I got tired of undocumented 3rd-party API changes breaking my apps, so I built Sentinel to passively detect JSON schema drift.

Hey everyone,

If you consume external REST APIs long enough, you know the pain: the provider silently drops a field, changes a string to an integer, or makes a previously required field optional. You usually only find out when your production app throws a null pointer exception or your DB rejects a type.

I built PHP Sentinel to solve this. It's a passive API contract monitor for PHP 8.3+ that sits in your HTTP client layer and watches the JSON coming back from the APIs you consume.

What it actually does: You don't write any schemas or rules by hand. Sentinel just silently observes the traffic.

1. Sampling: It watches the first X successful JSON responses for an endpoint.
2. Inference: It builds a probabilistically accurate JSON Schema (e.g., figuring out which fields are truly required vs which ones are just optional and happen to be missing sometimes).
3. Hardening: Once it hits the sample threshold (default 20), it locks the baseline schema.
4. Drift Detection: From then on, every new response is compared to the baseline in real-time. If the structure "drifts" (like a new field appears, or a required type changes), it dispatches an event and logs it.

Core features:

Zero-touch: Drop it into your PSR-18 client, Laravel `Http::` facade, or Symfony client and forget about it.
Smart Drift Rules: It knows that an optional field missing isn't drift, but a previously required field disappearing is a BREAKING change. A new undocumented field is just ADDITIVE.
Auto-healing: You can configure it to automatically "reharden" and build a new baseline after it reports a drift, so it adapts to legitimate API evolutions without you touching the code.
Framework Native: Comes with a Laravel ServiceProvider and a Symfony Bundle out of the box, plus an artisan/console CLI tool to inspect the inferred schemas manually.

Why I made it: Writing and maintaining OpenAPI specs for other people's APIs sucks. This is meant to be a passive safety net that gives you a Slack/log alert when a payload change happens, rather than digging through stack traces later.

It's fully unit-tested (Pest) and strictly typed (PHPStan Level 8).

Repo: https://github.com/malikad778/php-sentinel

I just pushed v1.0.3 and I'd love to hear what the community thinks. Are there specific edge cases in third-party API drift that you've been burned by? Any feedback on the architecture or inference engine would be awesome.

Thanks!

https://redd.it/1r9ze4l
@r_php
Why are so many packages designed exclusively for Laravel?

I have noticed that many packages that are being shared here lately are designed exclusively for Laravel. I know it is one of the largest (if not THE largest) framework for PHP, but does that mean that everyone should develop exclusively for it?

In my opinion every developer should look at the whole ecosystem around PHP and not just target one specific framework. IMO a framework agnostic package would be better as more people would benefit from it.

I don't want to link to any individual packages here because I don't want to blame the package maintainers. They have great ideas with their packages.

Of course, I don't have a solution for this. But I want to know if I am the only one who thinks this situation is going in the wrong direction or if my assumption is just plain wrong?

https://redd.it/1r8v229
@r_php
This media is not supported in your browser
VIEW IN TELEGRAM
I built this Laravel playground that runs completely in your browser (with no backend)

https://redd.it/1r8ezbx
@r_php
AuditTrailBundle v2 Released

Hi,

Thank you for your support and for showing interest in this project — I truly appreciate it.

I’ve put effort into improving the project by fixing code quality issues, strengthening security, and making it faster and more reliable.

Please note that this new version includes breaking changes, and I encourage you to upgrade to the latest version to benefit from these improvements.

You can review the changelog and benchmark results for more details.


cheers

https://redd.it/1rbeack
@r_php
Does anyone know any alternative for Laravel vscode extension? (A set of extensions is also fine)
https://redd.it/1rgxjsl
@r_php
Recommend please resources where I can learn internal PHP stuff

Recommend please resources where I can learn internal PHP stuff. l mean resources where I can learn how PHP works inside, it's internal mechanism and etc

https://redd.it/1rgyrf4
@r_php
I built a full open-source demo store with Laravel Shopper — Livewire 3, Volt, Flux UI, multi-currency checkout

Hey everyone,

I've been working on Laravel Shopper (an open-source e-commerce framework for Laravel) and just released a complete demo store to showcase what it can do.

Live demo: https://demo.laravelshopper.dev

Source code: https://github.com/shopperlabs/demo.laravelshopper.dev

What's in it:

\- Product catalog with attribute filtering

\- Variant selector with real-time stock checking

\- Multi-step checkout (shipping → delivery → payment)

\- Cash on delivery (Stripe coming soon)

\- Zone-based pricing with currency switching

\- Customer accounts with address management

\- Blog with categories

\- Full admin panel at /cpanel (Shopper + Filament 4)

Tech stack: Laravel 12, Livewire 3, Volt, Flux UI (free edition), Tailwind v4, Filament 4

The entire codebase is open source. Happy to answer any questions about the architecture or patterns used.

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