PHP Reddit – Telegram
PHP Reddit
34 subscribers
288 photos
36 videos
24.8K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
Recommend any newer PHP books?

I prefer books or ebooks over video tutorials. Recommend any? Thanks.

https://redd.it/1pybkv1
@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/1pycb04
@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/1pyfh2q
@r_php
Weird text "8194460" appearing on many laravel websites

Crossposting is not allowed, but I wanted to share this post by Maskedman1022000.

Basically, multiple websites have the number 8194460 appearing. When googling I was able to find a few pages that appear to have the number indexed by Google, but all of them just redirected to a login form.

Even https://filamentapps.com/ has it at the top of the website right now.

u/Maskedman1022000 experienced it on his site, but haven't been able to reproduce it in his dev environment.

This is a reminder to check if your pages contain the same bug, and to hear if anyone has more information on the issue.

https://redd.it/1pyhkqa
@r_php
Should it still use global, static and associative array?

dumb question should i still use global, static and associateive array?

https://redd.it/1pykn6w
@r_php
Do you prefer .php in URLs or hiding it? Also… am I structuring Core PHP wrong?


Hey folks,

Kind of a dumb question, but it’s been bugging me more than it should 😅
Do you prefer having .php in your app URLs, or keeping them clean without it?

I know it doesn’t really matter functionally, but seeing .php in URLs just bothers me for some reason.

So what I did was this:
I have an /authenticate route that contains:
- index.php
- style.css

Instead of /authenticate/index.php, when a user visits /authenticate/, they see the page directly.
I mainly did this to hide the .php part. I know this can also be handled properly using .htaccess (Apache) or Nginx rewrite rules, but this felt like a simple and clean solution to me.

GitHub repo: https://github.com/SurajRaika/artifact/
Live site: https://artifact.wuaze.com

Feel free to roast it

---

Another question while I’m here (would really love some advice):

When working with Core PHP, how do you usually structure your project?

What I’m currently trying is:
- Making small “components”
- Each component lives in a single folder
- That folder contains PHP, CSS, and JS related to that component

Something like:

component/
index.php
style.css
noscript.js

What are the pros and cons of doing it this way?
Is this a bad idea long-term?
Is there a better or more common approach when not using a framework?

I’m mostly experimenting and learning, but I feel like I might be reinventing some bad patterns

---

Also,:
I’m kind of looking for a PHP job, so I built this project as practice and something to show.

If anyone has advice, feedback, or even a referral (though I doubt it 🥲), I’d really appreciate it.

Thanks, and sorry if these are beginner-ish questions.
Just asking because most of you probably have way more experience than I do.

https://redd.it/1pyk3xi
@r_php
I modernized a decade-old PHP noscript for importing large MySQL dumps - now it's a full MVC app with 10-50x faster imports

Hello,

I've been working on BigDump, a staggered MySQL dump importer. The original noscript was created by Alexey Ozerov back in 2013, and I've completely refactored it into a modern PHP 8.1+ application.

The problem it solves:
phpMyAdmin times out on files >50MB on shared hosting. BigDump breaks imports into sessions that complete within your server's execution limit.

What's new in v2+:
- Full MVC architecture with PSR-12 compliance
- INSERT batching that groups simple INSERTs into multi-value queries (10-50x speedup)
- Auto-tuning based on available PHP memory
- SSE (Server-Sent Events) for real-time progress streaming
- Session persistence - resume after browser refresh or server restart
- Support for .sql, .gz, and .csv files

Technical highlights:
- Strict type declarations throughout
- Dependency injection via constructors
- Optimized SQL parsing using strpos() jumps instead of char-by-char iteration
- 64KB read buffer for reduced I/O overhead

GitHub: https://github.com/w3spi5/bigdump

It's MIT licensed. I'd love feedback on the architecture, and contributions are welcome. The roadmap includes parallel import streams and a REST API.

Has anyone else dealt with importing multi-GB dumps on constrained hosting? What solutions have you used?

https://redd.it/1pymls1
@r_php
The latest version of AuditTrailBundle

The latest version of AuditTrailBundle introduces a complete and production-ready auditing solution for Symfony applications.

you get:

Reliable core auditing for entity create, update, delete, and soft-delete operations
Attribute-based and YAML-based configuration options
Support for multiple audit transports, including chained transports
Transaction-level grouping of audit records for better traceability
Seamless EasyAdmin integration for audit inspection
A structured Audit Reader API for querying and filtering audit logs
A clear audit diff viewer showing old and new values
Safe and explicit revert capability based on audit history
Built-in support for Gedmo SoftDeleteable entities
Configurable retention policies for long-term audit data management


For detailed documentation and configuration examples, please refer to the README.

https://redd.it/1pym147
@r_php
Content management for laravel apps

Hi all! I have several laravel apps out there but the problem with the clients remains the same. They need a way to manage the marketing end of their app. Basically they need an advanced ‘editor’ like wordpress’ elementor but in the laravel ecosystem.

So far I’ve tried grapejs, ckeditor, filament’s v4 editor and even markdown editor. The clients seem to like tinymce which is what i have as default right now. I hate how tinymce works but it seems its the most feature rich editor (according to the clients at least). I have several opinionated clients that moonlight as designers.

So how do you guys handle such cases?

https://redd.it/1pypy6t
@r_php
I recently launched 2 laravel package , how should i promote it

I recently created and launched 2 laravel package, 1 a laravel installer package and another one is laravel health package. but both having less than 30 stars in github and less installs.

i created the packages , uploaded to github and packagist and waiting for people to use it. but whats the best way to let the developers know about the packages ?

please share your suggestions

https://redd.it/1pytiuy
@r_php
i refactored 2,400 lines of 2015 php spaghetti and the client’s app went from 8s load times to 1.2s

I took on a client project last month. saas app built in 2015, never touched since. php 7.2, laravel 5.something, zero tests, one 800-line controller, and page load times that made users think their wifi died.

client's exact words: "we're scared to change anything because we don't know what breaks."

so i treated the refactor like defusing a bomb: slow, methodical, with safety checks at every step.

the nightmare i inherited

here's what i was dealing with:

* one `OrderController.php` with 847 lines handling checkout, invoices, emails, pdf generation, and webhook callbacks in the same file
* n+1 queries everywhere (one page was hitting the db 340+ times)
* no service classes, no jobs, everything crammed into controllers
* blade templates with raw sql and business logic mixed in
* zero automated tests
* comments like `// TODO: fix this later (2016)`

load times averaged 6–8 seconds for the dashboard. client was losing signups because the checkout page took 12 seconds to render.

step 1: break it into phases instead of yolo refactoring

first mistake most devs make: trying to refactor everything at once.

i dumped the entire checkout flow into traycer and asked it to reverse-engineer what the code actually does and break it into phases. while i was using cursor to scaffold and refactor, i also had coderabbit reviewing the changes in real time so it could flag risky edits and edge cases as the code was being rewritten.

traycer gave me:

* phase 1: extract payment logic into service class
* phase 2: move email/pdf generation into queued jobs
* phase 3: fix n+1 queries with eager loading
* phase 4: split 800-line controller into smaller ones
* phase 5: clean up blade templates (remove business logic)

each phase was small enough that if i broke something, i'd know exactly where.

step 2: the before/after safety trick

here's what saved me from breaking everything:

before touching code in a phase:

* ran a local review on the old code, asked it: "what does this code do, what edge cases does it handle, what breaks if X happens"
* saved the response as `phase1-before.txt`

after refactoring:

* ran the same review on the new code
* saved as `phase1-after.txt`
* compared them

if the behavior denoscriptions didn't match = i broke something.

if they matched = safe to move on.

caught 3 bugs this way that i would've missed otherwise:

* weird timezone handling for EU orders
* silent error swallow that was actually preventing duplicate charges
* race condition with concurrent webhook callbacks

step 3: cursor doing the actual heavy lifting

for each phase, i fed cursor the spec from traycer and let it scaffold the new structure.

phase 1 example:

* cursor created the `PaymentService` class
* moved all stripe/payment logic from controller into service
* updated controller to use the service
* fixed all the imports automatically

did this in composer mode so it could edit multiple files at once. saved me hours of copy-paste-fix-imports hell.

then i'd run the before/after check, fix anything that diverged, write a few quick tests, and move to next phase.

step 4: fixing the performance disasters

once behavior was safe, i did a performance-focused review pass on each phase:

prompt i used:

>"scan for n+1 queries, missing indexes, heavy loops, and unnecessary db calls. show me file:line and a one-liner fix."

fed that back into cursor and let it optimize.

biggest win: the order listing page went from 340 db queries to 8 with proper eager loading. that alone dropped load time from 8s to 2s.

the results after 6 days

before:

* 2,400 lines across 4 files
* 6–8s average dashboard load
* 12s checkout page render
* zero tests
* client losing conversions because of speed

after:

* 1,850 lines across 14 cleaner files
* 1.2s dashboard load (83% faster)
* 2.8s checkout render (77% faster)
* 40+ tests covering critical paths
* client's conversion rate up 34% week one (pricing page was loading so slow)

https://redd.it/1pyvsls
@r_php
Evaluator – Laravel Powered MCQ Assessment Platform

I originally built this project several years ago for a company I worked with at the time, and later decided to refine it and make it open source.

Evaluator is specifically designed for internal assessments within companies and institutes. Imagine a management team needing to conduct a secure quiz to evaluate candidates’ knowledge. This is exactly where Evaluator fits. It includes unique security features, such as allowing candidates to participate without logging in and automatically submitting the assessment if they navigate away.

Use Cases:

Educational Institutions (universities, schools, etc.) – conduct quizzes, tests, weekly assessments, or practice exams.
Corporate Training – assess employee knowledge after training sessions or workshops.
Pre-Promotion Assessments – evaluate employees’ skills and competencies before promotions or role changes.
Recruitment \- evaluate candidates through structured MCQ-based questionnaires and skill assessments.
Event Management – run fun and engaging quizzes for events, competitions, or team-building activities.
Online Coaching & E-Learning Platforms – deliver topic-wise quizzes, mock tests, and learner progress tracking.
Certification Programs – create standardized assessments for validating skill levels or course completion.
Research & Surveys – collect data through interactive question sets for academic or market research.
Customer Engagement – use quizzes for brand engagement, product awareness, or promotional campaigns.
Compliance & Policy Training – ensure staff understand policies, safety protocols, or legal requirements.
Student Clubs & Communities – organize trivia events, knowledge battles, or club-specific assessments.

Whether you need a secure platform for formal evaluations or a flexible tool for interactive assessments, Evaluator has you covered.[](
https://lakm.gitbook.io/evaluator)

Key Features

🚀 Team Support – Organize users into teams to manage different business sections effortlessly.
📊 Dashboard Overview – Get a quick summary of all essential insights in one place.
🛠️ Advanced Admin Panel – Powerful tools to manage users, quizzes, and results with ease.
🏷️ Categorizable Quizzes & Questions – Group and manage quizzes and questions with smart categorization.
🎯 Difficulty Levels – Assign Easy, Medium, or Hard levels to each question for balanced tests.
🔐 Secure Access – Only admins log in; users receive unique secure codes to access quizzes.
🕒 Smart Security Tokens
One-time use
Auto-expiring
Revocable by admin
Timed Quizzes – Auto-submit after timeout; refreshing or closing invalidates the attempt.
🖼️ Image Attachments – Add and manage images for both questions and answers via an advanced image manager.
🖨️ Printable Quizzes – Generate A4-size quiz papers for offline use.
Real-Time Evaluation – Instant feedback on scores, accuracy, and performance metrics.
📋 Advanced Evaluation – Admins can review detailed answers; printable summaries available.
🔎 Elegant Data Tables – Filter, sort, and manage data efficiently.
Smart Form Validations – Prevent errors with built-in validations for all input fields.
📱 Responsive Design – Fully optimized for desktop, tablet, and mobile devices.
🎨 Modern UI/UX – Clean, intuitive, and designed for smooth user experience.
🌜 Dark Mode Support
⚙️ Performance Optimized – Built for speed and scalability.
💡 Syntax Highlighting – Enhanced readability for code-based questions.
🌟 And Many More! – Constantly evolving with new features and improvements.


REPO: https://github.com/Lakshan-Madushanka/evaluator-full-stack

https://redd.it/1pzhw38
@r_php
Votes needed for a VS Code feature request: Node filter for objects variables on debug hover

I requested this feature from the VS Code repo. Now, it needs 20 upvotes within 30 days to start development. If you find this feature helpful, please open the request and upvote. Thanks

https://github.com/microsoft/vscode/issues/279795

https://redd.it/1pznecw
@r_php
My "Ship Factory" for 12 SaaS products in 12 months (Laravel Octane + Traefik on VPS). Overkill?

I'm starting a challenge to ship 12 products in 2026. To avoid burnout, I need zero-friction deployments.

I skipped Vercel/Forge and built this on a $10 OVH VPS:

Backend: Laravel 12 + Octane (Swoole)
Frontend: Nuxt 4 SSR
Routing: Docker Compose + Traefik (auto SSL).
CI/CD: GitHub Actions.

A push to main builds the container, pushes to GHCR, and updates the stack on the VPS in < 2 mins.

Am I setting myself up for pain managing 12 Docker stacks manually over 12 months, or is this the optimal path for cost/performance control vs a PaaS?

https://preview.redd.it/ljl1jfpa1fag1.png?width=1024&format=png&auto=webp&s=fcec5c7398ff25c637ec7557c3a33316bdfd6a51



https://redd.it/1pzvfu8
@r_php
Which translation style do you use?

In Laravel we know multiple ways to handle translations. Are you a .json or a .php kinda person. Do you have multi layer directories or keep it simple?

Personally I have always done the php file with multiple directories per livewire component or domain of the application.

https://redd.it/1q09zk6
@r_php
Yii3 is released

It happened! Yii3 is officially released after years of intensive development and polishing.

Yii3 landing page
Official announcement
Documentation
• Application templates: Web, API, Console
• Demo applications: Blog (Layered DDD), Diary (Vertical slices, Active Record)

We're pretty sure the Yii3 codebase will serve us well in at least the next 10 years or even more.

Merry Christmas and Happy New Year! Enjoy! 🎉

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