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/1lo00kd
@r_php
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/1lo00kd
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Do you use any S3 based object storage?
At the moment I'm using Minio as a storage solution for media files (not large, but previews, images, etc.).
It does work, but after Minio removed it's UI from the opensource server, and I've found it scanning (health checker) quite resource heavy, I'm thinking of just using simply FS (Btrfs/ZFS/NFS mount, which also have encryption + compression), and just add an asset controller to retrieve it over Laravel (it also can handle policies and such)
The only downside would be you'll talk to your Laravel instance (but you can also use stream responses).
What do you use? Did you move to something like Seafoodfs or juicefs? Or just not S3 at all?
*I've got nothing against S3. I think it's work fine on AWS/DO. This is for more private managed projects.
https://redd.it/1lo3106
@r_php
At the moment I'm using Minio as a storage solution for media files (not large, but previews, images, etc.).
It does work, but after Minio removed it's UI from the opensource server, and I've found it scanning (health checker) quite resource heavy, I'm thinking of just using simply FS (Btrfs/ZFS/NFS mount, which also have encryption + compression), and just add an asset controller to retrieve it over Laravel (it also can handle policies and such)
The only downside would be you'll talk to your Laravel instance (but you can also use stream responses).
What do you use? Did you move to something like Seafoodfs or juicefs? Or just not S3 at all?
*I've got nothing against S3. I think it's work fine on AWS/DO. This is for more private managed projects.
https://redd.it/1lo3106
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
Can we already use property hooks with doctrine entites?
With PHP 8.4 we have property hooks and no longer need to write boilerplate getter/setter methods. Doctrine also supports property hooks with version 3.4.
Has anyone tried using them with the latest Symfony version? Are they already fully supported by Symfony? Or are there edge cases where they are not working nicely with Symfony currently?
https://redd.it/1loclqd
@r_php
With PHP 8.4 we have property hooks and no longer need to write boilerplate getter/setter methods. Doctrine also supports property hooks with version 3.4.
Has anyone tried using them with the latest Symfony version? Are they already fully supported by Symfony? Or are there edge cases where they are not working nicely with Symfony currently?
https://redd.it/1loclqd
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
Samarium ERP Update - Simple Business Management in PHP Laravel
Hello Everyone,
I shared my [Samarium](https://github.com/oitcode/samarium) project here a few months back, and I wanted to give you an update on the progress.
# What's [Samarium](https://github.com/oitcode/samarium)?
A simple, modular business management tool built with Laravel that handles:
* Invoice generation & finance tracking
* Website content management
* Task management
* Product/shop management
* Calendar & noticeboard features
# What's New Since Last Time
* **Improved Docker setup** \- Now easier to get running with docker-compose
* **Better module system** \- Enable/disable features through config
* **Enhanced UI customization** \- Bootstrap color themes configurable via config
* **More robust seeding** \- Creates sample data including admin user and basic website pages
* **Cleaner installation process** \- Both Docker and traditional setup options
# Why I Built This
Most ERP solutions are either too complex for small businesses or too expensive. Samarium aims to be the middle ground - powerful enough for real business use but simple enough that you're not drowning in features you don't need.
# Tech Stack
* **Backend**: Laravel, Livewire
* **Database**: MySQL 8.0+
* **Frontend**: Bootstrap + Blade templates
* **Containerization**: Docker support included
# What I'd Love Feedback On
* **Architecture**: How's the modular approach? Any suggestions for improvement?
* **Code quality**: Looking to follow PHP and Laravel best practices better
* **Feature gaps**: What would make this more useful for real businesses?
The project is MIT licensed and contributions are welcome. Would love to hear thoughts from the PHP, Laravel community.
**GitHub**: [https://github.com/oitcode/samarium](https://github.com/oitcode/samarium)
Been working on this as a side project to solve real business needs. Happy to answer any questions about the implementation or design decisions.
Thanks for your time.
https://redd.it/1lodzqe
@r_php
Hello Everyone,
I shared my [Samarium](https://github.com/oitcode/samarium) project here a few months back, and I wanted to give you an update on the progress.
# What's [Samarium](https://github.com/oitcode/samarium)?
A simple, modular business management tool built with Laravel that handles:
* Invoice generation & finance tracking
* Website content management
* Task management
* Product/shop management
* Calendar & noticeboard features
# What's New Since Last Time
* **Improved Docker setup** \- Now easier to get running with docker-compose
* **Better module system** \- Enable/disable features through config
* **Enhanced UI customization** \- Bootstrap color themes configurable via config
* **More robust seeding** \- Creates sample data including admin user and basic website pages
* **Cleaner installation process** \- Both Docker and traditional setup options
# Why I Built This
Most ERP solutions are either too complex for small businesses or too expensive. Samarium aims to be the middle ground - powerful enough for real business use but simple enough that you're not drowning in features you don't need.
# Tech Stack
* **Backend**: Laravel, Livewire
* **Database**: MySQL 8.0+
* **Frontend**: Bootstrap + Blade templates
* **Containerization**: Docker support included
# What I'd Love Feedback On
* **Architecture**: How's the modular approach? Any suggestions for improvement?
* **Code quality**: Looking to follow PHP and Laravel best practices better
* **Feature gaps**: What would make this more useful for real businesses?
The project is MIT licensed and contributions are welcome. Would love to hear thoughts from the PHP, Laravel community.
**GitHub**: [https://github.com/oitcode/samarium](https://github.com/oitcode/samarium)
Been working on this as a side project to solve real business needs. Happy to answer any questions about the implementation or design decisions.
Thanks for your time.
https://redd.it/1lodzqe
@r_php
GitHub
GitHub - shyamsitaula/samarium: Open-source business management system with ERP, POS, invoicing, and CMS features. Laravel-based…
Open-source business management system with ERP, POS, invoicing, and CMS features. Laravel-based, Docker-ready. Still in active development. - shyamsitaula/samarium
How to manage my datas? (HTML-Form, Array or mySQL)
Should I put my data structure as Array in a Class or as extended Array and then include?
My idea: I would like to manage charactersheets with html-forms and would like to store the datas into an MySQL-database.
I know the ‚basics‘ about the programming. All single parts are familiar for/with me. But I would like to manage the datas clever/smart.
Please tell me keywords/ articles/hints for my research. I would like to „Build“ my own experience.
Lots of thanks!
P.S.: sry, my english isn‘t well.
https://redd.it/1lobzrw
@r_php
Should I put my data structure as Array in a Class or as extended Array and then include?
My idea: I would like to manage charactersheets with html-forms and would like to store the datas into an MySQL-database.
I know the ‚basics‘ about the programming. All single parts are familiar for/with me. But I would like to manage the datas clever/smart.
Please tell me keywords/ articles/hints for my research. I would like to „Build“ my own experience.
Lots of thanks!
P.S.: sry, my english isn‘t well.
https://redd.it/1lobzrw
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
1 year of free Jetbrains products with no catch
https://www.jetbrains.com/store/redeem/
https://redd.it/1looe8j
@r_php
https://www.jetbrains.com/store/redeem/
https://redd.it/1looe8j
@r_php
JetBrains
Redeem Coupon or Promo Code - JetBrains
Looking to Migrate Laravel App to Hostinger – Is It a Good Fit for My Requirements?
I’m planning to migrate my Laravel application and considering Hostinger as a potential host. Before I pull the trigger, I’d love some community insight on whether it’s a good fit for my current and future needs.
Here’s what my Laravel app involves:
Multiple CRON jobs for scheduled tasks
In the near future, I’ll be integrating AI-based automation (like auto-filling forms, processing input, etc.)
Tally integration through API (accounting-related tasks)
WhatsApp integration to send automated messages on certain triggers
I'm looking for something that is:
Affordable
Scalable
Reliable with good performance and uptime
Supports SSH access, supervisor for queue workers, and possibly Docker if needed down the road
If Hostinger is not ideal for this kind of setup, I'd appreciate recommendations for other good and cheap hosting providers that can support these features.
Thanks in advance!
https://redd.it/1louz5d
@r_php
I’m planning to migrate my Laravel application and considering Hostinger as a potential host. Before I pull the trigger, I’d love some community insight on whether it’s a good fit for my current and future needs.
Here’s what my Laravel app involves:
Multiple CRON jobs for scheduled tasks
In the near future, I’ll be integrating AI-based automation (like auto-filling forms, processing input, etc.)
Tally integration through API (accounting-related tasks)
WhatsApp integration to send automated messages on certain triggers
I'm looking for something that is:
Affordable
Scalable
Reliable with good performance and uptime
Supports SSH access, supervisor for queue workers, and possibly Docker if needed down the road
If Hostinger is not ideal for this kind of setup, I'd appreciate recommendations for other good and cheap hosting providers that can support these features.
Thanks in advance!
https://redd.it/1louz5d
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Just shipped: n8n Laravel Client – a fluent PHP bridge to n8n’s public REST API and Workflow Triggers
https://github.com/kayedspace/laravel-n8n
https://redd.it/1loy9r8
@r_php
https://github.com/kayedspace/laravel-n8n
https://redd.it/1loy9r8
@r_php
GitHub
GitHub - kayedspace/laravel-n8n: Laravel N8N: A complete, expressive and fluent Laravel client for the n8n public REST API and…
Laravel N8N: A complete, expressive and fluent Laravel client for the n8n public REST API and Webhooks Triggering. - kayedspace/laravel-n8n
FILAMENT 4 is 3x FASTER?! Mind-Blowing Upgrade!
https://youtu.be/uJfFURplMQg?si=nTdIHY1Dz2Lfhuyb
https://redd.it/1loztab
@r_php
https://youtu.be/uJfFURplMQg?si=nTdIHY1Dz2Lfhuyb
https://redd.it/1loztab
@r_php
YouTube
FILAMENT 4 is 3x FASTER?! Mind-Blowing Upgrade!
💎 Learn From the Laravel Masters on Laracasts: https://laracasts.com/?ref=nunomaduro
🛠️ Code with JetBrains PHPStorm for world-class PHP development: https://jb.gg/nuno
🔥 The most epic event is coming this summer: https://lrvl.co/birthday-taylor
✨ Business…
🛠️ Code with JetBrains PHPStorm for world-class PHP development: https://jb.gg/nuno
🔥 The most epic event is coming this summer: https://lrvl.co/birthday-taylor
✨ Business…
I have completed react js and now I need to learn backend.
Hello everyone, as I mentioned that I have already completed react js and now I want to learn backend with complexity. Even though most of the people says php is not relevant nowadays but I want to ask the php devs themselves.
Is php still shining or not ? And if yes, then what should be my approach towards learning PHP ? Like, what technologies should I go for in php.
https://redd.it/1lp13ib
@r_php
Hello everyone, as I mentioned that I have already completed react js and now I want to learn backend with complexity. Even though most of the people says php is not relevant nowadays but I want to ask the php devs themselves.
Is php still shining or not ? And if yes, then what should be my approach towards learning PHP ? Like, what technologies should I go for in php.
https://redd.it/1lp13ib
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
How does anyone use breakpointing in Laravel
I come from a c# world where when you breakpoint through your code, and you hover over anything, you see its properties and nothing else.
When i breakpoint through my code and hover back over a line of code like this: $firstResult = Todo::where('year', '2025')->first();
Why do i see: "resolver", "dispatcher", "booted", trainInitializers", "globalScopes", "ignoreOnTouch", "modelsShouldPreventLazyLoading" and like 500 other things?
How can I change this and only see what I need to see? If not, how do you guys deal with all this useless information?
I'm using phpstorm with xdebug.
Also how come in this if statement if I hover over "completed" it doesnt show me the value?
If ($firstResult->completed == true) {
...
}
https://redd.it/1lp4toi
@r_php
I come from a c# world where when you breakpoint through your code, and you hover over anything, you see its properties and nothing else.
When i breakpoint through my code and hover back over a line of code like this: $firstResult = Todo::where('year', '2025')->first();
Why do i see: "resolver", "dispatcher", "booted", trainInitializers", "globalScopes", "ignoreOnTouch", "modelsShouldPreventLazyLoading" and like 500 other things?
How can I change this and only see what I need to see? If not, how do you guys deal with all this useless information?
I'm using phpstorm with xdebug.
Also how come in this if statement if I hover over "completed" it doesnt show me the value?
If ($firstResult->completed == true) {
...
}
https://redd.it/1lp4toi
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Named Queued Closures & New Assert Redirect Back in Laravel 12.13
https://youtu.be/dri0BgJjB_w
https://redd.it/1lpb7uy
@r_php
https://youtu.be/dri0BgJjB_w
https://redd.it/1lpb7uy
@r_php
YouTube
Named Queued Closures & New Assert Redirect Back in Laravel 12.13
What's new in Laravel is back! We share new features of the Laravel framework every week 🙌 (today v12.13)
1️⃣ Named Queued Closures
https://github.com/laravel/framework/pull/55634
2️⃣ Assert Redirect Back
https://github.com/laravel/framework/pull/55635…
1️⃣ Named Queued Closures
https://github.com/laravel/framework/pull/55634
2️⃣ Assert Redirect Back
https://github.com/laravel/framework/pull/55635…
Feedback wanted: Small Laravel + Tailwind business dashboard (Profile, 2FA, Invoices)
Hey all!
I made a super minimal Laravel portal for a small business. It’s basically just: login, Google Authenticator MFA (2FA), and a dashboard with four icons (Email, Invoices, Purchase Invoices, Profile).
**I recorded a quick walkthrough here:**
👉 [YouTube: Laravel Minimal Dashboard Demo:
https://www.youtube.com/watch?v=RcIgFoQ9xj4&ab\_channel=jackson\_design3d
**Tech stack:**
\- Laravel 12
\- Tailwind CSS
\- Blade components
\- Login & Google Authenticator MFA
**Features:**
\- Simple navigation (Dashboard/Profile)
\- Profile page with edit info, change password, enable/disable 2FA
\- Responsive/modern UI (mostly Tailwind, custom CSS)
\---
**Looking for feedback on:**
**1. Security**
\- Best way to add Google Authenticator MFA in Laravel, while keeping it user-friendly and cheap?
\- How do you validate 2FA codes securely in Laravel?
**2. Hosting**
\- Fastest & cheapest way to host a Laravel portal with login + 2FA? Any gotchas?
**3. UI/UX**
\- Tips to make a super simple dashboard (just 4 icons) look clean?
**4. Extensibility**
\- How do you keep a small Laravel project future-proof if I might want to add Google Sheets/Gmail features later?
**5. Performance**
\- Must-do speed tweaks for a minimal Laravel app?
**6. General**
\- Is a minimalist Laravel dashboard overkill for small businesses, or actually a good idea?
Any other advice is welcome! If you want code snippets or repo structure just ask.
Thanks in advance 🙏
https://redd.it/1lpcgou
@r_php
Hey all!
I made a super minimal Laravel portal for a small business. It’s basically just: login, Google Authenticator MFA (2FA), and a dashboard with four icons (Email, Invoices, Purchase Invoices, Profile).
**I recorded a quick walkthrough here:**
👉 [YouTube: Laravel Minimal Dashboard Demo:
https://www.youtube.com/watch?v=RcIgFoQ9xj4&ab\_channel=jackson\_design3d
**Tech stack:**
\- Laravel 12
\- Tailwind CSS
\- Blade components
\- Login & Google Authenticator MFA
**Features:**
\- Simple navigation (Dashboard/Profile)
\- Profile page with edit info, change password, enable/disable 2FA
\- Responsive/modern UI (mostly Tailwind, custom CSS)
\---
**Looking for feedback on:**
**1. Security**
\- Best way to add Google Authenticator MFA in Laravel, while keeping it user-friendly and cheap?
\- How do you validate 2FA codes securely in Laravel?
**2. Hosting**
\- Fastest & cheapest way to host a Laravel portal with login + 2FA? Any gotchas?
**3. UI/UX**
\- Tips to make a super simple dashboard (just 4 icons) look clean?
**4. Extensibility**
\- How do you keep a small Laravel project future-proof if I might want to add Google Sheets/Gmail features later?
**5. Performance**
\- Must-do speed tweaks for a minimal Laravel app?
**6. General**
\- Is a minimalist Laravel dashboard overkill for small businesses, or actually a good idea?
Any other advice is welcome! If you want code snippets or repo structure just ask.
Thanks in advance 🙏
https://redd.it/1lpcgou
@r_php
YouTube
online portal website php walkthrough
Preparing for a 1-hour Symfony + React live coding challenge for a senior dev role — any tips or similar experiences?
Hi everyone,
I have a live coding session coming up for a senior Symfony developer position. The challenge is about 1 hour long and will likely involve building or extending a Symfony backend CRUD API with entities like Product and Category having a Many-to-Many relation, plus a React frontend that interacts with the API.
I expect to:
Implement create/list/update endpoints on the backend using Symfony (Doctrine ORM, validation, serialization groups, DTOs)
Build a React form to create or update products, handle validation errors from the backend, and fetch categories dynamically.
Has anyone done a similar live coding challenge at a senior level?
What should I prioritize during my preparation to demonstrate senior-level skills efficiently within such a time constraint? Any resources, example projects, or advice on balancing Symfony backend and React frontend work during the session?
Thanks in advance!
https://redd.it/1lphwog
@r_php
Hi everyone,
I have a live coding session coming up for a senior Symfony developer position. The challenge is about 1 hour long and will likely involve building or extending a Symfony backend CRUD API with entities like Product and Category having a Many-to-Many relation, plus a React frontend that interacts with the API.
I expect to:
Implement create/list/update endpoints on the backend using Symfony (Doctrine ORM, validation, serialization groups, DTOs)
Build a React form to create or update products, handle validation errors from the backend, and fetch categories dynamically.
Has anyone done a similar live coding challenge at a senior level?
What should I prioritize during my preparation to demonstrate senior-level skills efficiently within such a time constraint? Any resources, example projects, or advice on balancing Symfony backend and React frontend work during the session?
Thanks in advance!
https://redd.it/1lphwog
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
Scramble 0.12.23 – Laravel API documentation generator update: Paginated results inference, improved documentation of authorization error responses, error-tolerant validation rules evaluation, and various type inference improvements.
https://scramble.dedoc.co/blog/scrambledrop-scramble-01223
https://redd.it/1lpr1an
@r_php
https://scramble.dedoc.co/blog/scrambledrop-scramble-01223
https://redd.it/1lpr1an
@r_php
scramble.dedoc.co
#scrambledrop: Scramble 0.12.23 - Scramble
OpenAPI (Swagger) documentation generator for Laravel. Without manual PHPDoc annotations.
PHP Mini-Unconference on WorkAdventure? Gauging Interest
Hi r/PHP 👋
I just came back from the online **PHPVerse** conference. Great talks! But, like many virtual conferences, it felt a bit like watching a playlist: the very best speakers you can get, but almost no chance to bump into people, chat, or linger with the presenters.
I’d love to try something different: a **60‑minute, free, community‑driven (un)conference** hosted on a WorkAdventure map (a [2D virtual world platform with proximity video chat and meeting rooms](https://play.staging.workadventu.re/@/tcm/workadventure/wa-village) I'm working on)
(Un)conference format:
* **3 parallel rooms**: follow what is the most interesting to you
* **20‑minute slots**: because the attention span on a remote event is smaller compared to an in-person event
* **Anyone** can grab a slot. First come, first served; so new voices get the mic ✨
* Roam the pixel map between rooms and **hang out** with speakers afterward
If it clicks, we can rinse‑and‑repeat every month or so. I'm looking to gauge the interest in this idea before putting my heart and soul in it. **Interested?**
* Drop a +1 below if you’d attend.
* Comment if you’d like to speak (topic ideas welcome!)
* Any suggestions (time zone, tooling, format...): let me know!
Let’s see if we can make online PHP meet‑ups fun again. 🎉
Thanks!
https://redd.it/1lprq2d
@r_php
Hi r/PHP 👋
I just came back from the online **PHPVerse** conference. Great talks! But, like many virtual conferences, it felt a bit like watching a playlist: the very best speakers you can get, but almost no chance to bump into people, chat, or linger with the presenters.
I’d love to try something different: a **60‑minute, free, community‑driven (un)conference** hosted on a WorkAdventure map (a [2D virtual world platform with proximity video chat and meeting rooms](https://play.staging.workadventu.re/@/tcm/workadventure/wa-village) I'm working on)
(Un)conference format:
* **3 parallel rooms**: follow what is the most interesting to you
* **20‑minute slots**: because the attention span on a remote event is smaller compared to an in-person event
* **Anyone** can grab a slot. First come, first served; so new voices get the mic ✨
* Roam the pixel map between rooms and **hang out** with speakers afterward
If it clicks, we can rinse‑and‑repeat every month or so. I'm looking to gauge the interest in this idea before putting my heart and soul in it. **Interested?**
* Drop a +1 below if you’d attend.
* Comment if you’d like to speak (topic ideas welcome!)
* Any suggestions (time zone, tooling, format...): let me know!
Let’s see if we can make online PHP meet‑ups fun again. 🎉
Thanks!
https://redd.it/1lprq2d
@r_php
play.staging.workadventu.re
WorkAdventure - WA Village
Organize your online event in WorkAdventure to recreate spontaneous social interactions. Connect, collaborate and have fun with your teammates and attendees.
Case study: A Long-Term Powerhouse Behind Vente-unique.com's E-Commerce Success (Zero Churn, All Wins!)
https://symfony.com/blog/case-study-a-long-term-powerhouse-behind-vente-unique-com-s-e-commerce-success-zero-churn-all-wins?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1lpqyb2
@r_php
https://symfony.com/blog/case-study-a-long-term-powerhouse-behind-vente-unique-com-s-e-commerce-success-zero-churn-all-wins?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1lpqyb2
@r_php
Symfony
Case study: A Long-Term Powerhouse Behind Vente-unique.com's E-Commerce Success (Zero Churn, All Wins!) (Symfony Blog)
From Symfony 1.0 to 6.4 — Vente-unique.com has powered its entire e-commerce platform with Symfony for over 15 years! Discover how Symfony scaled with them from ERP to marketplace, handling 3M+ cus…
package-ui.nvim now supports multiple dependency managers, including Composer
https://github.com/MonsieurTib/package-ui.nvim
https://redd.it/1lpta33
@r_php
https://github.com/MonsieurTib/package-ui.nvim
https://redd.it/1lpta33
@r_php
GitHub
GitHub - MonsieurTib/package-ui.nvim: Interactive package management UI for Neovim. Browse, search, install and manage packages…
Interactive package management UI for Neovim. Browse, search, install and manage packages with a beautiful multi-panel interface - MonsieurTib/package-ui.nvim
QR Code SMS generation - different behavior on iPhone vs Android
Hi!
I'm generating QR codes for SMS messages in PHP, but I'm struggling with platform differences. I want to pre-fill only the message body, letting users choose their own recipient - but different platforms behave weirdly.
What I've Tested:
Format:
- ✅ iPhone: Perfect! Empty recipient, message pre-filled
- ❌ Android: Opens Notes app instead of SMS (wtf?)
Format:
- ✅ Android: Works perfectly
- ❌ iPhone: Shows annoying "Add to Contact" popup
Format:
- ✅ iPhone: Works well, but requires phone number
- ✅ Android: Also works, but requires phone number
My Current PHP Code:
My Goal:
Generate QR codes that open SMS app on both platforms with:
- ✅ Pre-filled message body
- ✅ Empty/no recipient (user adds their own)
- ✅ No "Add to Contact" popups
- ✅ No wrong apps opening (looking at you, Android Notes!)
Questions:
- Is there a universal format for SMS without phone number?
- Why does Android open Notes for
- Any workarounds or alternative approaches?
- Should I detect user agent and serve different QR codes?
Has anyone solved this cross-platform SMS QR puzzle? Any help appreciated! 🙏
Environment:
- PHP 7.4+
- QR libraries: phpqrcode or chillerlan/php-qrcode
- Target: iOS Safari & Android Chrome
https://redd.it/1lps6t9
@r_php
Hi!
I'm generating QR codes for SMS messages in PHP, but I'm struggling with platform differences. I want to pre-fill only the message body, letting users choose their own recipient - but different platforms behave weirdly.
What I've Tested:
Format:
sms:?body=message (no phone number)- ✅ iPhone: Perfect! Empty recipient, message pre-filled
- ❌ Android: Opens Notes app instead of SMS (wtf?)
Format:
sms:+48123456789?body=message (with number)- ✅ Android: Works perfectly
- ❌ iPhone: Shows annoying "Add to Contact" popup
Format:
SMSTO:+48123456789:message (with number)- ✅ iPhone: Works well, but requires phone number
- ✅ Android: Also works, but requires phone number
My Current PHP Code:
// What I want to achieve:
$qr_content = "sms:?body=" . urlencode($sms_body); // iPhone ✅, Android ❌
// What works but requires number:
$qr_content = "SMSTO:+48123456789:" . $sms_body; // Both ✅, but I don't want number
QRcode::png($qr_content, $filepath, "M", 8, 2);
My Goal:
Generate QR codes that open SMS app on both platforms with:
- ✅ Pre-filled message body
- ✅ Empty/no recipient (user adds their own)
- ✅ No "Add to Contact" popups
- ✅ No wrong apps opening (looking at you, Android Notes!)
Questions:
- Is there a universal format for SMS without phone number?
- Why does Android open Notes for
sms:?body=?- Any workarounds or alternative approaches?
- Should I detect user agent and serve different QR codes?
Has anyone solved this cross-platform SMS QR puzzle? Any help appreciated! 🙏
Environment:
- PHP 7.4+
- QR libraries: phpqrcode or chillerlan/php-qrcode
- Target: iOS Safari & Android Chrome
https://redd.it/1lps6t9
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community