r_php | Unsorted

Telegram-канал r_php - PHP Reddit

33

Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram

Subscribe to a channel

PHP Reddit

New in Symfony 8.2: EntityExists, Cron and Audio Constraints
https://symfony.com/blog/new-in-symfony-8-2-entityexists-cron-and-audio-constraints?utm_source=Symfony%20Blog%20Feed&utm_medium=feed

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

Читать полностью…

PHP Reddit

new methods for SQL queries

Hello everyone—new methods for development with the IssuesPHP framework


$query = IpModel::ChosenAll($this->table);

$query = IpModel::chosenOne($this->table,1);

$query = IpModel::chosenOrLost($this->table,1);

return $query;

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

Читать полностью…

PHP Reddit

OIDC Provider (OP) library creation

Hi all! So recently, I was trying to find a package that would provide an OIDC Server implementation that I could integrate into my project to provide feature-rich functionality for OIDC authentication.
Unfortunately, I was not able to find any package to cover my needs:
thephpleague/oauth2-server \- provides only an OAuth2 server, no OIDC
oidcphp/core \- seems to be abandoned
PEOFIAMP/phpoidc \- listed as a certified library but does not look like a usable library
Because of that, I've started thinking about actually building one that would also be universal in terms of implementation and dependencies, so anyone will be able to pull it into their own project by extending/implementing the needed contracts.


My initial plan is to take some package from another language and at least implement some portion of the specifications for the OIDC provider protocol. After that, I think it would also be a great idea to provide packages for any popular frameworks (Symfony, Laravel, etc.).
Because of that, I would like to ask if any of you see possible use cases for your own projects? I mean, if you see that it would be really worth trying to build and share with the public.
Thank you in advance for any additional ideas/topics/suggestions that might be helpful to consider. And I would be happy to get any feedback to understand if it even makes sense to move forward with this whole idea.

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

Читать полностью…

PHP Reddit

Big benchmark of ways to run PHP

I've made some benchmarks of various servers and modes of running PHP. What was benched:

* PHP-FPM + Nginx
* FrankenPHP (classic and worker)
* Rapira (classic, worker, dispatcher)
* OxPHP (classic, worker)
* RoadRunner
* FreeUnit
* Swoole


Every server was running a simple Yii3 application. Two separate endpoints and benchmarks. One is without DB, plain PHP. Another is actually hitting PostgreSQL, which is closer to real apps.


Some insights:


1. Swoole is a performance beast! Rapira in dispatcher/worker modes is close.

2. FreeUnit is great if you run your app in classic mode.

3. Having a database makes the difference less visible. Worker mode gives 2× RPS on average.

4. Swoole and Rapira are very efficient in terms of CPU/memory.


[https://yii3-benchmarks.github.io/app-api/](https://yii3-benchmarks.github.io/app-api/)

[https://github.com/Yii3-Benchmarks/app-api](https://github.com/Yii3-Benchmarks/app-api)

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

Читать полностью…

PHP Reddit

New in Symfony 8.2: Compiled Event Dispatcher
https://symfony.com/blog/new-in-symfony-8-2-compiled-event-dispatcher?utm_source=Symfony%20Blog%20Feed&utm_medium=feed

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

Читать полностью…

PHP Reddit

Inertia Omega - Inertia.js server-side protocol for Rust
https://github.com/inertiajs/inertia-omega

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

Читать полностью…

PHP Reddit

Vellum: a fumadocs inspired markdown docs framework for laravel
https://vellum.jimmyverburgt.com/

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

Читать полностью…

PHP Reddit

SymfonyCon Warsaw 2026: From 14s to 1.8s: A Symfony Cold Start Autopsy
https://symfony.com/blog/symfonycon-warsaw-2026-from-14s-to-1-8s-a-symfony-cold-start-autopsy?utm_source=Symfony%20Blog%20Feed&utm_medium=feed

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

Читать полностью…

PHP Reddit

PHPStan 2.3: Leap in Performance, Generics Improvements, Detecting Unused Variables, and More!
https://phpstan.org/blog/phpstan-2-3-leap-in-performance

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

Читать полностью…

PHP Reddit

PHPStan 2.3: Leap in Performance, Generics Improvements, Detecting Unused Variables, and More!
https://phpstan.org/blog/phpstan-2-3-leap-in-performance

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

Читать полностью…

PHP Reddit

Is anyone here using Drupal Steward?
/r/drupal/comments/1wyndv3/is_anyone_here_using_drupal_steward/

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

Читать полностью…

PHP Reddit

SymfonyCon Warsaw 2026: final class Entity: Doctrine Mapping for Modern PHP
https://symfony.com/blog/symfonycon-warsaw-2026-final-class-entity-doctrine-mapping-for-modern-php?utm_source=Symfony%20Blog%20Feed&utm_medium=feed

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

Читать полностью…

PHP Reddit

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/1wxy58i
@r_php

Читать полностью…

PHP Reddit

Native Windows app (WinUI, with hot reloading) driven by SuperNative - NativePHP Desktop v3 WIP
https://youtu.be/8-RVc7vvTlQ

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

Читать полностью…

PHP Reddit

I built a Laravel audit log that doesn’t lose user context in queues and background jobs

Most audit loggers work fine for simple CRUD cases, but start to break down when you introduce:

queues (jobs)
background commands (artisan / scheduler)
chains of actions across multiple jobs
changes made without a direct user context

And in the end, you lose the most important part, who actually initiated the change. I tried to solve exactly this problem.

What the package does:

automatically logs Eloquent model changes
no traits or observers required
supports actors: user / job / command / scheduler
preserves the origin user even inside queued jobs
links everything via a correlation ID (request → jobs chain)
shows full change history per model
supports “time travel” (model state at a given date)
flags noisy / empty updates
includes simple anomaly rules (bulk changes, activity spikes)

Additional features:

optional UI at /audit-log
JSON API for custom frontends
subject reports (GDPR-style)
integrity checks (hash chain)
works with any queue driver (sync / database / Redis / SQS)

Installation:
composer require romalytar/yammi-audit-log-laravel
php artisan migrate
php artisan audit-log:ui enable

https://preview.redd.it/3baoeir17w6h1.png?width=1230&format=png&auto=webp&s=11c03bf0974159b19607f10663a4409b775a808d

https://preview.redd.it/8ysmkir17w6h1.png?width=1235&format=png&auto=webp&s=72eca53e0afb93e3c0ce2a046d9f24796737641a

After that, it starts working automatically without any model configuration.
Happy to hear any feedback, especially if you’ve dealt with similar issues around losing context in queued systems.

GitHub: https://github.com/RomaLytar/yammi-audit-Log

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

Читать полностью…

PHP Reddit

Laravel Adds Support for the New HTTP QUERY Method

I was confused when I first saw this news, so I dug into it and decided to break it down in simple terms, since it’s actually a different context.

This was proposed in [RFC 10008](https://www.rfc-editor.org/info/rfc10008/) and was accepted recently.

`QUERY` is a proposed HTTP method designed for **safe, cacheable requests that need to send a request body containing query parameters**.

QUERY /users/search HTTP/1.1
Content-Type: application/json

{
"name": "John",
"age": {
"gte": 30
}
}

This is useful when a query is too complex or too large to comfortably put in a URL:

GET /users/search?name=John&age_gte=30

# Why is QUERY interesting? / When should you use it?

The key idea is:

**QUERY is a safe HTTP method that allows a request body.**

Imagine you have a complicated product search.

With normal `GET`, you'd potentially end up with:

GET /products?
category=electronics&
price_min=100&
price_max=500&
brands[]=apple&
brands[]=samsung&
features[ram]=16&
features[storage]=512

That's awkward when the query becomes large or highly structured.

With `QUERY`, you can do:

QUERY /products/search
Content-Type: application/json

{
"category": "electronics",
"price": {
"min": 100,
"max": 500
},
"brands": [
"apple",
"samsung"
],
"features": {
"ram": 16,
"storage": 512
}
}

The important distinction is:

GET
└── safe/read operation
└── traditionally query parameters in URL

QUERY
└── safe/read operation
└── query parameters can be sent in request body

# Laravel now supports:

Route::query('/products/search', function () {
return request()->input();
});

# And on the HTTP client side, Laravel provides:

$response = Http::query('/products/search', [
'category' => 'electronics',
'price' => [
'min' => 100,
'max' => 500,
],
]);

# Conclusion

Traditionally:

* `GET` → query parameters in the URL, but request bodies aren't reliably supported
* `POST` → can have a body, but semantically often means "create/process something"
* `QUERY` → intended to mean **"retrieve something using this query body"**

So conceptually:

GET → retrieve resource
POST → submit/process/create
QUERY → retrieve using a structured query

However, `QUERY` **is not currently a universally supported standard HTTP method like GET/POST/PUT/PATCH/DELETE**. Support depends on the HTTP server, framework, clients, proxies, etc.

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

Читать полностью…

PHP Reddit

built a lightweight open-source analytics tool in PHP + SQLite because Node.js should NOT be the default option

hi everyone,

5 days ago i asked here why every self-hosted analytics tool needs Node.js/Docker, and said i might build a PHP + SQLite one. so, i did.

it's called Minilytics. it is open-source and runs on any PHP 8 host with no Node, no Docker and no database server (Sqlite by default, but you can use MySQL or MariaDB). it has sessions, custom events, funnels, a cookieless mode, and an importer from Umami and others importers are planed! (this allowed me to get my old history back).

it's a v1 from a solo builder, its MIT licensed, with a live demo: https://minilytics.axthauvin.fr/

i'd like this to become the go-to lightweight analytics for indie devs, side projects, and any site that just needs simple, private stats, so tell me what's missing for you to use it on a real site !

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

Читать полностью…

PHP Reddit

Feedback wanted: SSR-friendly localized routes with Vue, Ziggy and Wayfinder
matteo.palazzo/localized-laravel-routes-in-vue-with-ziggy-and-wayfinder-edf4219f455e" rel="nofollow">https://medium.com/@matteo.palazzo/localized-laravel-routes-in-vue-with-ziggy-and-wayfinder-edf4219f455e

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

Читать полностью…

PHP Reddit

I got tired of updating every route() call when a URL changed, so I built entity routing for Laravel

Laravel fills one placeholder from a model: route('posts.show', $post) works for {post} or {post:slug}. As soon as a URL has several placeholders, every call site has to list them:

Route::get('/articles/{id}/{slug}', ShowArticle::class)->name('articles.show');

route('articles.show', ['id' => $article->id, 'slug' => $article->slug]);


Then SEO asks for a {category} in the URL, and you hunt down every one of those calls.

CakePHP has had "entity routing" for years: you pass the entity, the router extracts each placeholder from it. I wanted the same in Laravel, so I built it:

entity_route('articles.show', $article); // /articles/42/my-title


Add {category} to the route later, and that line does not change.

How each placeholder is resolved (first match wins):

1. Explicit value: entity_route('articles.show', $article, ['slug' => 'other'])
2. A mapping the model declares, with dot paths or closures: 'year' => fn ($a) => $a->published_at->year
3. Binding fields: {category:slug} reads $article->category->slug
4. Route key: {article} on an Article uses getRouteKey()
5. Attribute of the same name: {slug} reads $article->slug
6. URL::defaults()

Works with Eloquent models, arrays, ArrayAccess and plain objects. Missing required placeholders throw a clear exception (listing the route, the entity class and what is missing), optional ones are dropped.

Other bits:

- URL::entityRoute() and redirect()->toEntityRoute() macros
- Opt-in flag so the native helpers accept it too: route('articles.show', ['_entity' => $article]), including to_route(), signed URLs and Blade. Off by default, and calls without _entity are untouched.
- For Inertia: a HasEntityUrls trait adds the resolved URLs to the model's JSON, so the frontend gets exactly the same URLs as the backend, without Ziggy or Wayfinder having to know the rules.
- Generation only: no database, no extra routes, route model binding untouched, works with route:cache.

Laravel 12 and 13, PHP 8.2+, no dependency besides illuminate/*, 100% test coverage, Larastan at max level.

composer require kareylo/laravel-entity-routing


GitHub: https://github.com/Kareylo/laravel-entity-routing

It is still 0.x, so I would really like feedback before 1.0: does the resolution order make sense to you? Is there a case where you would expect a different URL? And would a client-side TypeScript helper be useful, or is sending resolved URLs from the server enough?

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

Читать полностью…

PHP Reddit

Classify text in PHP without an LLM bill: typed text decisions in 100+ languages, self hosted. Laravel-ready SDK for Laya, a Jev AI alternative.
https://github.com/marcreichel/laya-php

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

Читать полностью…

PHP Reddit

What's New in Laravel 13.34: Queue Timeouts, maxExceptions & Job Duration

Jobs, Jobs & Jobs

This Laravel 13.34 release is all about our favorite Laravel feature.

Look at these nice additions:

➡️ Jobs duration
➡️ Timeout warnings
➡️ Crashes count towards maxExceptions

Thank you Jack & William 🙏

https://youtu.be/BEEPbbW09Vg

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

Читать полностью…

PHP Reddit

I built a lightweight E-commerce engine on pure PHP 8.3/MySQL with a custom MVC and no bulky framework dependencies

Hey r/PHP,

I wanted to share a project I’ve been working on: CoreCommerce. It’s an open-source, full-featured e-commerce platform built from scratch using pure PHP 8.3+ and MySQL 8.0+, without relying on Laravel, Symfony, or heavy CMS engines.

The main goal was to prove that you can achieve maximum performance, maintain modern development standards, and keep a clean, lightweight codebase without the overhead of massive vendor directories.

🛠️ Technical Highlights & Architecture:

Custom MVC Framework: Built-in routing (`app/Core/Routing/Router.php`), controllers, and models. It supports RESTful route patterns, GET/POST requests, and clean URL parameters.
Database Layer: A PDO-based wrapper implementing a lightweight Active Record pattern with a migration system for schema versioning.
Modular Plugin & Theme Systems: Hook-based extensible architecture (`PluginManager`) and theme inheritance supporting asset versioning for asset cache busting.
Multi-language Out of the Box: Highly deterministic localization layer (EN, UA, PL) where adding a new language literally takes two configuration steps without code modifications.

🧠 The Category Filtering Pipeline & Features

The project features an optimized ProductFilterService using a strict 3-step SQL pipeline with isolated EXISTS subqueries instead of heavy JOIN chains. It also includes robust security measures (CSRF, bcrypt, rate limiting, secure headers) and 16 built-in production services like Prom.ua sync, LiqPay integration, search ranking, and image optimization.

The full open-source project and repository details can be found in the referenced source.

To view the code, go to https://github.com/coordinatescms-ai/CoreCommerce.

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

Читать полностью…

PHP Reddit

PHPStan 2.3: Leap in Performance, Generics Improvements, Detecting Unused Variables, and More!
https://phpstan.org/blog/phpstan-2-3-leap-in-performance

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

Читать полностью…

PHP Reddit

New in Symfony 8.2: Relative Ordering for Listeners and Services
https://symfony.com/blog/new-in-symfony-8-2-relative-ordering-for-listeners-and-services?utm_source=Symfony%20Blog%20Feed&utm_medium=feed

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

Читать полностью…

PHP Reddit

Is anyone here using Drupal Steward?
/r/drupal/comments/1wyndv3/is_anyone_here_using_drupal_steward/

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

Читать полностью…

PHP Reddit

Is anyone here using Drupal Steward?
/r/drupal/comments/1wyndv3/is_anyone_here_using_drupal_steward/

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

Читать полностью…

PHP Reddit

Laravel in rust

Taylor seems to be teasing a rust version of laravel on X. What are your thoughts?

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

Читать полностью…

PHP Reddit

Migrating a large Laravel app from CKEditor 4 to Editor.js — looking for architectural advice

Hey everyone,

I’m working on a fairly large Laravel application that currently uses CKEditor 4, and migrating to Editor.js is now a requirement.

The project uses the Repository Pattern, and CKEditor is used across multiple modules. I’m trying to figure out the right way to approach the migration without making a huge change all at once.

My main concerns are:

* Where should Editor.js-related logic live in a Repository Pattern project?
* Should I create a separate service for Editor.js, or keep things within the existing module structure?
* How should validation and sanitization be handled?
* What’s a good approach for rendering Editor.js JSON on the frontend?
* We already have a lot of CKEditor HTML stored in the database. What’s the safest way to handle/migrate that?
* Is it better to migrate module-by-module while keeping CKEditor working for the modules that haven't been migrated yet?
* What would you recommend for the overall folder/file structure?

I’m especially interested in hearing from anyone who has migrated CKEditor/TinyMCE or another HTML-based editor to Editor.js in a large Laravel application.

I’m a junior developer, so I’d really appreciate practical advice on how you would structure this rather than just “replace the editor” at the frontend level.

Thanks!

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

Читать полностью…

PHP Reddit

Which Programming Language Can Handle the Most Users on a $12 Server?
https://www.youtube.com/watch?v=sQXFhh_PiG4

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

Читать полностью…

PHP Reddit

Hibla Database - A complete standalone, async-first query builder and schema manager for PHP 8.4+

Hi everyone. I wanted to share an open-source project I have been working on called Hibla Database. It is a fully asynchronous database layer built on PHP 8.4 fibers and promises.

If you have ever used an async database library in PHP, you know exactly what I mean when I say the developer experience is pretty terrible. You are usually stuck writing raw queries without any high-level abstractions, and there is almost no tooling to manage schemas, seeders, pagination, or anything like that. Right now, there is basically zero framework-agnostic, 'developer-experience-focused' async database tooling out there (correct me if I'm wrong).

This library aims to solve this problems by bringing the expressive, fluent query syntax of Laravel and the standalone, non-blocking execution model of Knex.js directly to the modern PHP. It is completely framework agnostic and designed to fit into any microframework like Slim or Leaf, or any PHP applications.

Here are the direct links to the source code on GitHub:

Meta Package (the main documentation hub): https://github.com/hiblaphp/database

Query Builder (Standalone Query Builder): https://github.com/hiblaphp/query-builder

Schema Manager (the CLI, migrations, seeders, and schema squashing tool): https://github.com/hiblaphp/schema-manager

Some of the features we focused on include:

\- True asynchronous query execution by building on top of existing hiblaphp/mysql and hiblaphp/postgres library.

\- A zero-boilerplate CLI setup that scaffolds database, migration, and seeder configs in seconds, supporting directory auto-discovery without complex composer namespace mapping.

\- Unified multi-connection pipelines that let you run migrations and seeders across PostgreSQL and MySQL concurrently in a single command.

\- Full support for dependency injection via interfaces, allowing you to bypass our static DB facade entirely to build highly testable, decoupled, and clean architectures.

\- A database-agnostic query builder with built-in, non-blocking offset and cursor pagination (which can render Tailwind/Bootstrap HTML links or output API-ready JSON payloads instantly).

\- Advanced programmatic SQL compiling, including fully fluent recursive Common Table Expressions (CTEs), JSON array/length filters, and PostgreSQL pgvector columns.

\- A production safe mode that strictly blocks schema-destructive commands in production, safely ignoring the force flag.

The codebase is strictly typed with PHPStan Level Max under strict rules and is tested in CI against live MySQLand PostgreSQL databases on both PHP 8.4 and 8.5.

I would love to get your feedback, questions, and code reviews on the repositories. Let me know what you think...

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

Читать полностью…
Subscribe to a channel