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

PHP Landscape Survey

Disclaimer: I'm employed for Perforce Zend.

Calling PHP developers! The 2026 State of Open Source and PHP Survey needs your technical perspective. Help us analyze enterprise OSS adoption patterns and PHP ecosystem evolution.
Plus, for every 500 responses we receive, we'll increase our donation to open source initiatives by $1K 

We will be closing the survey soon. I can share the report with the community once produced in the spring!


https://www.surveymonkey.com/r/7SXYYMQ

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

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

PHP Reddit

ANN Restler v6.0.0: Zero-Boilerplate PHP REST API Framework with Async Support

Hi r/PHP! 👋

We're excited to announce Restler v6.0.0, a complete rebuild of our PHP REST API framework that's been in production since 2010.

# What's Restler?

Restler is for developers who want to build REST APIs in PHP without fighting boilerplate. You write a class, Restler handles the rest:

class Products {
function get(int $id): array {
return Database::findProduct($id);
}
}

$api = new Restler();
$api->addAPIClass(Products::class);
$api->handle();

That's it.

Routes? Auto-generated.
Validation? Type hints + PHPDoc.
Documentation? OpenAPI 3.0 auto-generated.
Content negotiation? JSON, XML, CSV, Excel—automatic.
HTTP status codes? Correct ones, automatic.

# What's New in v6?

1. Async Performance

Swoole/ReactPHP support: 10-15x throughput vs traditional PHP-FPM
AWS Lambda/serverless ready (via Bref)
Same code works on all runtimes

2. Modern PHP 8+

Full PHP 8.0-8.5 support
Strict typing throughout
PSR-7 HTTP messages
PSR-11 container

3. Security First

Replaced unsafe `unserialize()` with JSON (prevents object injection)
JSONP callback validation
Template variable hardening
Professional security policy

4. Multi-Format

GET /api/products/123 → JSON
GET /api/products/123.xml → XML
GET /api/products/123.csv → CSV
GET /api/products/123.xlsx → Excel

One class. Every format.

5. Complete Documentation

12 comprehensive guides
18+ working examples
Migration guide from v5
Security best practices

# Comparison with Other Frameworks

|Feature|Restler|Laravel|Symfony|
|:-|:-|:-|:-|
|Boilerplate (LOC)|5|50+|60+|
|Learning curve|Minimal|Steep|Steep|
|Auto-docs|✅|🔨|🔨|
|Multi-format|✅|🔨|🔨|
|Type safety|✅|✅|✅|
|Async ready|✅|❌|❌|
|For APIs|✅ Primary|✅ Secondary|✅ Secondary|

Note: This is our take. Other frameworks are great for different use cases.

# Upgrading from v5

If you're using v5:

Minimal breaking changes
Migration guide: https://github.com/Luracast/Restler/blob/master/MIGRATION.md
Most APIs migrate in 2-4 hours
Same simplicity, better performance

# Getting Started

composer require luracast/restler:^6.0

Full docs: https://github.com/Luracast/Restler

# The Numbers

15 years in production
500K+ Packagist downloads
1,300+ GitHub stars
98.8% test coverage
Zero CVEs in recent versions
10-15x performance with async (Swoole)

# Community & Support

Questions? [GitHub Discussions](https://github.com/Luracast/Restler/discussions)
Issues? GitHub Issues
Security? [SECURITY.md](https://github.com/Luracast/Restler/blob/master/SECURITY.md)

# Why This Matters

If you've been frustrated with:

Boilerplate in your REST API framework
Slow performance with traditional PHP-FPM
Overhead of learning complex frameworks just for an API
Documentation that's outdated or incomplete

Restler might be the framework you've been looking for.

We're not trying to replace Laravel/Symfony (great frameworks!). We're offering a focused, simple alternative for API development.

# Questions I Expect

Q: Why not just use Laravel/Symfony?
A: For APIs, Restler does more with less. But Laravel/Symfony are great for web apps.

Q: Is it battle-tested?
A: 15 years in production. Fortune 500 companies use it. Zero recent CVEs.

Q: What if I need a web UI?
A: Restler focuses on APIs. Use it with a separate frontend (React, Vue, etc.).

Q: How hard is the migration from v5?
A: 2-4 hours for typical APIs. See migration guide.

Q: Can I use it with Laravel?
A: Restler is standalone. But you could use both (Restler with Laravel components).

Q: What about GraphQL?
A: Built-in support in v6.

# Links

GitHub:

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

PHP Reddit

Using landlock in a php script

There's a maturing API in Linux called landlock. It looks really promising as a way for applications to state their access intentions and then lock themselves into that.

Based on dealing with past PHP exploits, this would be a great additional way to limit access to the filesystem and to the network in a way that would be another speed bump for the nefarious out there.

However, the settings remain active for a thread/process. I haven't really dug into the weeds on low level php deployments. Do the usual deployment models launch threads/processes for each script or use a thread/process pool? If the latter, this wouldn't work.

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

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

PHP Reddit

[RFC] Pattern Matching
https://wiki.php.net/rfc/pattern-matching

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

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

PHP Reddit

Laravel Octane + Multi-tenancy + Yajra Datatables: Second tenant can't load data (state leaking issue)

Hey everyone, I'm stuck with a tricky state leaking problem and hoping someone has dealt with this scenario before.

**My Stack:**

* Laravel with Swoole via Octane
* Multi-tenancy using `stancl/tenancy` (archtechx/tenancy)
* Redis for cache with tenant-specific prefixes
* Yajra Datatables for server-side processing

**The Problem:**
When the **first tenant** logs in after `octane:reload`, everything works perfectly - all datatables load data correctly. However, when a **second tenant** logs in (using the same worker/PID), some datatables simply don't return data even though the records exist in their database. It's not all datatables - some work fine, but specific ones consistently fail for the second tenant.

**What I've Tried:**

* Enabled `RedisTenancyBootstrapper` and `CacheTenancyBootstrapper` in tenancy config
* Set `persistent => false` in Redis connection config
* Added `Redis::purge()` in `TenancyBootstrapping` event
* Used `app()->forgetInstance()` for redis, cache, and [cache.store](http://cache.store)
* Added Yajra classes to Octane's `flush` array
* Created middleware to reset datatables instances per request
* Verified Redis keys have correct tenant prefixes (they do!)

**Debug Info:**

* Logs confirm the tenant boots correctly with the right prefix
* Same worker PID serves both tenants (expected with Octane)
* Redis disconnect/purge logs appear correctly
* The issue is NOT with all datatables, only specific ones

**My Theory:**
Since Redis isolation seems correct (keys have proper prefixes), I suspect the Yajra Datatables service is holding onto the `Request` object or query state from the first tenant, even after attempting to flush it. But I can't pinpoint exactly what's being cached in memory.

Has anyone successfully run this exact combo (Octane + stancl/tenancy + Yajra Datatables)? Is there a known incompatibility or specific service that needs manual cleanup between tenant switches?

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

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

PHP Reddit

Laravel Christmas themed advent calendar - quiz app
https://youtu.be/ymXqrRRrnqM

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

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

PHP Reddit

Sustainability of Open Engineering
krakjoe/sustainability-of-open-engineering-b33db9d4923c" rel="nofollow">https://medium.com/@krakjoe/sustainability-of-open-engineering-b33db9d4923c

https://redd.it/1pb6qv9
@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/1pb3332
@r_php

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

PHP Reddit

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

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

PHP Reddit

Guidance on how to refactor a legacy (>10 years old) application?

I'm a junior dev with only basic knowledge of modern PHP (since all main webdev related languages tend to work the same after all) and I can understand what a modern app works (even if I still have to grasp what some PSR are about).

That said, my first ever "real job", after a short internship as a NET6 dev, will be to help and refactor an old application made in PHP5 and with hundreds of files mixing rendering, queries and buisness logic.

The app is very delicate and manages millions of dollars in transactions daily so it's really important that nothing breaks.

Conceptually I know how one should approach the refactoring: modularize the pages in an MVC like architecture and use the legacy php files as controllers, add testing (and perhaps introduce Twig instead of relying on string manipulation or even a framework like Symphony to avoid reinventing the wheel on routing/controllers and security?) but as you may imagine, for a jr like me it feels also really overwhelming, do you have any book/course you think may help me approach this challenge?

I'm still thinking about grabbing a course on Udemy to learn modern PHP development first thing first lol but refactoring feels really intimidating, like "correcting" another developer with much more experience than you

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

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

PHP Reddit

SymfonyCon talks, slides and code examples are on GitHub
https://github.com/SymfonyCon/2025-talks

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

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

PHP Reddit

NativePHP for Mobile v2 is here
https://nativephp.com/docs/mobile/2/getting-started/changelog

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

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

PHP Reddit

NativePHP for Mobile v2 is here
https://nativephp.com/docs/mobile/2/getting-started/changelog

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

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

PHP Reddit

Speedup PHPUnit code coverage generation
https://staabm.github.io/2025/11/26/speedup-phpunit-code-coverage.html

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

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

PHP Reddit

PHP Prisma: Integrate multi-media related LLMs easily

PHP Prisma is a light-weight PHP package for integrating multi-media related Large Language Models (LLMs) using a unified interface:

**https://php-prisma.org**

The new release adds:

New interfaces for recognize (OCR) and vectorize (embeddings)
Support for async remote APIs which requires polling
Implemented Amazon Bedrock imagine, isolate, inpaint and vectorize
Implemented Black Forest Labs imagine, inpaint and uncrop
Added Mistral recognize for OCR
Implemented vectorize for Cohere
Implemented vectorize for VoyageAI
Improved documentation

PHP Prisma concentrates on image (incl. audio/video LLM APIs in the upcoming releases) and is a sister project of Prism PHP, which is build for text/stuctured/streaming content.

If you like it, give it a star:
**https://github.com/aimeos/prisma**

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

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

PHP Reddit

https://github.com/Luracast/Restler
Packagist: [https://packagist.org/packages/luracast/restler](https://packagist.org/packages/luracast/restler)
Documentation: https://github.com/Luracast/Restler/blob/master/README.md
Blog Post: [https://luracast.com/blog/restler-v6-launch](https://luracast.com/blog/restler-v6-launch) (link to your blog)
Discussions: https://github.com/Luracast/Restler/discussions

We'd love your feedback! Ask questions, share experiences, or tell us what you think.

Excited to hear what you build with Restler v6! 🚀

# P.S.

If you try it, drop a comment here. Love it? Hate it? Somewhere in between? Let us know!

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

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

PHP Reddit

What’s one “unpopular opinion” you have about modern PHP development?

I feel like everyone talks about frameworks, performance, and best practices, but PHP devs rarely share the real hot takes. So I’m curious:

What’s one opinion you have about PHP that most devs would probably disagree with?

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

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

PHP Reddit

Literature

It’s been a while since I’ve looked at any Laravel books. What are the current books out there for building modern applications using best practices?

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

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

PHP Reddit

Laravel is hiring a Community Manager!

Hey all! Admin approved message here. :)

Laravel is hiring a Community Manager to engage with the community on X, Discord, and here on Reddit of course.

Link to job →  https://apply.workable.com/laravel/j/D34D04F351/

You'd work closely with Marketing, Dev Rel, and our Product teams. It's great for someone who has a background in Laravel but doesn't want to spend their whole day in the code mines anymore.

We also have a few other roles open if that one doesn't strike your fancy. Feel free to DM me me if you have questions or just comment here.



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

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

PHP Reddit

We built an AI powered PHP framework

Hey everyone

We’ve been working on a new PHP framework and wanted to share it here ! The idea was to combine the best of both worlds : Laravel and Symfony, to create something that feels like us.
One of the things we are really excited about is that we integrated a bridge between Symfony AI and our framework, so you can use AI directly inside the framework. Our goal is to make it easier to use AI in real projects without a lot of work.
We’d love to hear your thoughts, feedback or suggestions for improvements. We still working on it and it is challenging !
Thanks in advance !

https://github.com/doppar/doppar

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

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

PHP Reddit

Why setting your PHP memory limit to 60GB won't help
https://devcenter.upsun.com/posts/why-setting-your-php-memory-limit-to-60gb-wont-help/

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

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

PHP Reddit

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

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

PHP Reddit

AI Vibe Software Development Coding Repair
https://ottstreamingvideo.net/ai-vibe-coding-repair

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

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

PHP Reddit

php-collective/framework-comparison: Compare some metrics of popular PHP frameworks
https://github.com/php-collective/framework-comparison

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

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

PHP Reddit

A Week of Symfony #987 (November 24–30, 2025)
https://symfony.com/blog/a-week-of-symfony-987-november-24-30-2025?utm_medium=feed&utm_source=Symfony%20Blog%20Feed

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

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

PHP Reddit

SymfonyCon talks, slides and code exemples are on GitHub
https://github.com/SymfonyCon/2025-talks

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

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

PHP Reddit

Small Tool for create php openSwoole /apache / NginX Rest Api

This lightweight tool designed for create Microservice Rest-Api on OpenSwoole, NginX and Apache. **gemvc** . it is MIT-license and open-source.

easy install:

composer require gemvc/library

then :

php vendor/bin/gemvc init

finally choose your server and configuration easily and finish by

docker compose up -d --build

it is AI-Ready , cursor and copilot detect it right after installation , but it is better to copy README.md to chat right after init process and prompt: read and learn it compleetly.

github : github.com/gemvc/gemvc

i wish this post be useful for your next project

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

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

PHP Reddit

A small php library to generate dynamic email marketing countdowns.
https://github.com/ivanpreziosi/phpEmailTimer

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

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

PHP Reddit

What kind of design pattern is Laravel using here?

https://preview.redd.it/m7yawqm3iz3g1.png?width=1444&format=png&auto=webp&s=5f4176cb5264005b2a3ebb1024707eeb5d51b9f7

Hey folks,

What kind of desing patterns do you think Laravel is using here? Let's learn some from the great Laravel console codebase.

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

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

PHP Reddit

I am creating a VSCode Symfony Extension

I've been a Symfony developer for years. While I love VSCode's speed, I often miss the deep framework understanding that PhpStorm offers—especially when refactoring code or exploring the Service Container.

So, I decided to build a comprehensive extension to bridge this gap. I'm getting close to a Public Preview and wanted to share the feature list to gauge community interest.

**The "Killer Feature": Safe Refactoring** Existing extensions usually only handle PHP symbols. My extension implements a **Symfony-Aware Rename Provider**. *This was actually my first need and the first module developed.*

* If you rename a Class or Service in PHP, it safely scans and updates references in your **config files (YAML/XML)** automatically.
* No more broken service definitions or manual find-and-replace after a refactor.

**⚡ The "Intelligence" Stack (Implemented Features)** My goal was to bring visibility to the "magic" of Symfony using **TreeViews** (side panel explorers) and **CodeLens** (inline context info):

* **Services & Parameters:**
* **TreeView:** Browse your full compiled container services and parameters.
* **CodeLens:** Inline insights on service injections and parameter values directly in your code.
* **Routes:**
* **TreeView:** Visualize all application routes (methods, paths).
* **CodeLens:** Annotated controller methods showing their mapped route info.
* **Autowiring:**
* **TreeView:** Explore available autowirable types.
* **CodeLens:** See exactly which service is being injected into your type-hinted arguments.
* **Configuration & Dotenv:**
* **TreeView:** Navigate config namespaces and environment variables.
* **CodeLens:** View documentation for config nodes and see resolved `.env` values directly inside your YAML files.
* **Twig:**
* **TreeView:** Browse available filters, functions, and tests with integrated documentation.
* **Nelmio API Docs:**
* **TreeView:** Explore your API documentation models.
* **CodeLens:** Contextual info on PHP Attributes and config files.
* **Command Executor:**
* Execute `bin/console` commands directly from the VSCode Command Palette (with GUI argument builders).

I want this tool to be sustainable and professionally maintained over the long term. My plan is to release a **Public Preview** soon for everyone to test.

Once it reaches **Stable v1.0**, I intend to use a **Freemium model**.

**I'd love to hear your thoughts** about this extension, what features you miss and what would make you switch from PHPStorm to VSCode?

I'll be dropping the beta link here soon if there's interest!

Thanks!

[General demo](https://reddit.com/link/1p8gzwg/video/3qad2hmy7w3g1/player)



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

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