PHP Reddit
31 subscribers
308 photos
40 videos
25.3K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
I built scout-postgres: a PostgreSQL-native Laravel Scout engine for search without Meilisearch/Algolia/Typesense
/r/laravel/comments/1svihnd/i_built_scoutpostgres_a_postgresqlnative_laravel/

https://redd.it/1svihxj
@r_php
Non-incremental sequential IDs using BIGINT?

I've been looking at various ways to obfuscate database IDs to thwart enumeration. Hashids are out because they're not actually secure. UUIDv7 and ULID are good but their length will make for some big indices once you factor in foreign keys too.

Then I had a thought: We're all using BIGINT primary keys these days. A millisecond Unix timestamp easily fits with some headroom. So why not use: [timestamp][randomnumber]?

If we move the epoch from 1970 to 2025, we buy back more space for randomness. With 1,000,000 variations per millisecond, you'll need to be writing >1,000 records per ms for a 50% chance of a collision.

You could go further and just use microseconds and be fine unless you're writing more than 1,000,000,000 records per second somehow. (I suspect some platforms don't advance the clock accurately enough for this, resulting in duplicate times)

For non-mission critical applications that can absorb very occasional collisions, ULID looks overengineered. What do you think?

https://redd.it/1svmvxm
@r_php
Built a Moonshot AI (Kimi K2.6) driver for the new laravel/ai SDK
/r/laravel/comments/1svhq81/built_a_moonshot_ai_kimi_k26_driver_for_the_new/

https://redd.it/1svhqvb
@r_php
Need a XAMPP Alternative?

Hey fellow PHP devs,

If you’re still using XAMPP or getting annoyed with Laragon’s license pop-ups, you might want to check this out.

I built PyAMPP, a lightweight Windows tool that works similarly to XAMPP or Laragon, but with a more streamlined setup and less overhead. It allows you to quickly install and manage Apache, MySQL, PHP, and phpMyAdmin through a simple interface without dealing with complicated configuration.

I originally made this because I got tired of local server tools breaking or acting up, so I learned how to set up my own stack and eventually turned it into a reusable tool.

If you’re working with PHP or Laravel and want something straightforward and fast for local development, feel free to try it out.

GITHUB: https://github.com/rdevz-ph/PyAMPP-Windows
DOCUMENTATION: https://rdevz-ph.github.io/PyAMPP-Windows/

Feedback is welcome.

https://redd.it/1svrzbk
@r_php
Symfony Kit For Developers - Last Updates

Hi guys!


Last post doing auto-promo of the extension. I do not want to spam.


So have uploaded the latest version, also I have published the repo

https://github.com/andrescevp/symfony-kit-for-developers


It is the public site and will be used to coordinate bugs, questions, features requests, and insider program


The website is in https://andrescevp.github.io/symfony-kit-for-developers/


Hope this can evolve as I expect, and hope you guys found the extension usefull.


Have great dev journey!

https://redd.it/1svvr1w
@r_php
Symfony Kit For Developers - Last Updates
/r/symfony/comments/1svvr1w/symfony_kit_for_developers_last_updates/

https://redd.it/1svvr9q
@r_php
kreuzcrawl, an open source crawling engine with PHP bindings

kreuzcrawl is a high-performance web crawling engine. It was designed to reliably extract structured data, operating natively across multiple languages without enforcing a specific runtime. More details: https://github.com/kreuzberg-dev/kreuzcrawl.

The MCP server is integrated from the start, enabling web-crawling AI agents as a primary use case. Streaming crawl events allow real-time progress tracking. Batch operations handle hundreds of URLs concurrently and tolerate partial failures. Browser rendering supports JavaScript-heavy SPAs and includes WAF detection.


Supported language interfaces are Rust, Python, Node.js, Go, Ruby, Java, C#, PHP, Elixir, WASM, and C FFI, and each binding connects directly to the core engine.
Kreuzcrawl is part of the Kreuzberg org: https://kreuzberg.dev/

We welcome your feedback and would be happy to hear how you plan to use it



https://redd.it/1svze3w
@r_php
Redesigned my Stopwatch profiler with ui.sh (before/after)

Bought a ui.sh license a few months back. Closed the tab, forgot about it. Sat down with it properly this week and ended up rewriting the HTML render of one of my packages in an evening. Left side of the image is 0.4.x. Right side is what I tagged today.

before\/after

It's a small Laravel profiler I maintain (SanderMuller/Stopwatch). You drop checkpoints, it shows where time went. The render had been the same plain table forever. On my "tomorrow" list for at least a year.

You describe what you want, you get 2–3 directions back, you pick one. First round is usually whatever, by round 3 or 4 I was tweaking actual details. It noticed I had CSS variables in the file and themed around them instead of replacing them, which I appreciated.

Iterations aren't mockups either. Sometimes you get a screenshot, sometimes a carousel of live versions you can actually click through. At one point a tooltip kept misaligning, turned out a parent transform was making a new containing block, and we ended up restructuring the DOM.

Went in just wanting visual polish, ended up adding a bunch of stuff I hadn't planned. Overview bar with per-checkpoint segments. Tiered slow highlighting. A light/dark toggle. A clipboard button that copies a Markdown summary so I can paste slow profiles into Claude. Half of those came from the tool nudging me — like, it suggested theme support and I realized yeah, I'd actually use that. Also inline-styled with hex fallbacks so the same render works in notification emails, which was a pain.

If you use /ui or ui.sh, what do you point it at? I've mostly done component-level things, would love to hear if anyone's used it for marketing pages or full app shells, and whether you've found an iteration workflow that holds up. I kept losing track of which round had the best version of which detail. Felt like I needed git for screenshots.

If you haven't tried it, what's stopping you? Price, generic-AI-design vibes, prefer to write the CSS yourself?

Paying customer, not affiliated.

https://redd.it/1swcbrv
@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/1swrvl3
@r_php
Scramble 0.13.21 – Laravel API documentation generator update: JSON:API support, `toResource` and `toResourceCollection` support, Laravel Query Builder improvements
https://scramble.dedoc.co/blog/scrambledrop-scramble-01321

https://redd.it/1swx6qa
@r_php
PHPArkitect 1.0 is out. Curious how people approach architecture testing in PHP these days

Just tagged 1.0 of PHPArkitect after a long stretch of small releases, and figured I'd post here partly to share it and partly because I'm genuinely curious about how (or whether) people use this kind of tool.

If you haven't seen it: it's a way to write architectural rules as PHP code and fail your CI when something violates them. Stuff like "nothing in App\Domain is allowed to depend on App\Infrastructure" or "all controllers' class name must end in Controller".

A rule looks like this:

  Rule::allClasses()
->that(new ResideInOneOfTheseNamespaces('App\Domain'))
->should(new NotHaveDependencyOutsideNamespace('App\Domain'))
->because('we want to protect our domain from external dependencies');


The 1.0 mostly cleans things up rather than adding huge new features. Baseline matching is smarter, PHP core classes (Exception, DateTime, PDO...) are auto-excluded so you stop having to list them in every rule, there's HaveTrait /NotHaveTrait, IsNotA, recursive in excludePath, and catch / @throws are now picked up as dependencies. PHP 7 support is gone and the PHAR build was hardened with php-scoper.

Repo if you want to poke around:
https://github.com/phparkitect/arkitect

What I'd actually like to know:

- Anyone here using PHPArkitect, Deptrac, or rolling something custom?
- If you do use one, what did you mainly use it for? What problem were you actually trying to solve?
- If you tried one and stopped, what was the breaking point?

I have my own theories but they're probably biased, so happy to be told I'm wrong

https://redd.it/1swy82y
@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/1swv2s1
@r_php
GitHub Copilot cambia su modelo de precios en mayo 2026: ¿qué significa para los desarrolladores?

GitHub Copilot cambia su modelo de precios en mayo 2026: ¿qué significa para los desarrolladores?



GitHub ha anunciado cambios significativos en GitHub Copilot que entrarán en vigor durante mayo 2026. La compañía pasa a un esquema más orientado al uso real, ante el fuerte aumento de costos generado por los nuevos flujos de trabajo agénticos.



Principales cambios:



*Se pausan las nuevas suscripciones a los planes Pro, Pro+ y Student.

*Se endurecen los límites de uso en los planes existentes.

*El modelo Opus de Anthropic desaparece del plan Pro (10 USD/mes) y solo estará disponible en Pro+ (39 USD/mes).



Según documentos internos, el costo semanal de operar Copilot se ha duplicado desde enero 2026. Una sola sesión agéntica puede consumir más recursos que docenas de autocompletados tradicionales, lo que ha llevado a que algunos usuarios de 10 dólares mensuales generen costos de cientos de dólares por semana.



La buena noticia para los usuarios actuales:

Los suscriptores existentes de Copilot Pro mantienen su acceso sin modificaciones en sus condiciones actuales. Los cambios afectan principalmente a nuevos suscriptores y a los límites de uso futuros.



Microsoft y GitHub justifican estas medidas como necesarias para “proteger la experiencia de los clientes existentes” ante el explosivo crecimiento del consumo de IA.



¿Estás usando Copilot? ¿Cómo crees que te afectará este cambio?



\#GitHubCopilot #GitHub #InteligenciaArtificial #Desarrolladores

Khainata

https://redd.it/1sxcxb9
@r_php
Implementing BCrypt in pure PHP - Handling 32-bit logic on 64-bit systems

Hey everyone, I’m currently writing my Bachelor’s thesis, which is actually a continuation of a project started by a previous student. Their work covered several other cryptographic primitives and the whole thing was built in Laravel, so I’m stuck implementing BCrypt in pure PHP to keep everything consistent within that same codebase.

The main issue is that BCrypt is fundamentally built on 32-bit unsigned integer math, but modern PHP uses 64-bit signed integers. I’m having a hard time figuring out the cleanest way to handle the overflows so that the variables wrap around exactly like they would in C. If they don't, the internal state of the P-array and S-boxes gets totally messed up.

I’ve been looking at a few ways to handle this. One option is to just use bitwise masks like & 0xFFFFFFFF after every single addition, XOR, or shift. It seems like the most direct way to force a 32-bit state, but I’m worried my code is going to look like a total mess of masks for my final submission. I’ve also thought about using modulo math to handle the wrap-around, but I’ve heard that can get pretty weird in PHP when dealing with negative results or very large integers.

The other headache is that PHP doesn't have a native unsigned right shift (>>>). I’m trying to simulate it by shifting and then manually clearing the sign bit with a mask, but I’m worried about the performance and accuracy since the algorithm has to do thousands of iterations for the key schedule.

If you were in my shoes and had to stay within PHP to match the existing Laravel setup, how would you go about the 32-bit manipulation? Would you stick to heavy masking, try to abstract it into helper methods, or is there some other way to handle low-level bitwise stuff that I’m missing? I’d really appreciate any insight from people who have messed with this kind of thing before. Thanks!

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