Config vs. Enum for Managing Supported File Conversions – What’s Your Preference?
Hey r/Laravel community! 👋
A few weeks ago, I launched **Doxswap** (pre-release), a Laravel package for **seamless document conversion** (DOCX → PDF, Markdown → HTML, etc.). The response was **really positive**, and I got **valuable feedback**—especially from this subreddit! 🙌
Now, as I work toward **Doxswap v1**, I’m tackling a design decision:
# 🔍 The Problem
I need a way to **store and validate**:
* **Which conversions are supported** (e.g., DOCX → PDF is valid, but PNG → DOCX is not).
* **MIME types for each format** (e.g., `application/pdf` for PDFs).
* **Easy maintenance & future expansion** (new formats, integrations, etc.).
Right now, I’m debating between **storing this data in a config file (**`config/doxswap.php`**)** or using an **Enum class (**`DocumentFormat::class`**)**. I’d love to hear your thoughts! 🚀
Currently in the pre-release it's all stored in config. But I plan on adding more conversion drivers which could make the doxswap config bloated as I would have to specify support conversions and mime types for each conversion driver.
Option 1: stick with config
'drivers' => [
'libreoffice' => [
'path' => env('LIBRE_OFFICE_PATH', '/usr/bin/soffice'),
'supported_conversions' => [
'doc' => ['pdf', 'docx', 'odt', 'rtf', 'txt', 'html', 'epub', 'xml'],
'docx' => ['pdf', 'odt', 'rtf', 'txt', 'html', 'epub', 'xml'],
'odt' => ['pdf', 'docx', 'doc', 'txt', 'rtf', 'html', 'xml'],
'rtf' => ['pdf', 'docx', 'odt', 'txt', 'html', 'xml'],
'txt' => ['pdf', 'docx', 'odt', 'html', 'xml'],
'html' => ['pdf', 'odt', 'txt'],
'xml' => ['pdf', 'docx', 'odt', 'txt', 'html'],
'csv' => ['pdf', 'xlsx', 'ods', 'html'],
'xlsx' => ['pdf', 'ods', 'csv', 'html'],
'ods' => ['pdf', 'xlsx', 'xls', 'csv', 'html'],
'xls' => ['pdf', 'ods', 'csv', 'html'],
'pptx' => ['pdf', 'odp'],
'ppt' => ['pdf', 'odp'],
'odp' => ['pdf', 'pptx', 'ppt'],
'noscript' => ['pdf', 'png', 'jpg', 'tiff'],
'jpg' => ['pdf', 'png', 'noscript'],
'png' => ['pdf', 'jpg', 'noscript'],
'bmp' => ['pdf', 'jpg', 'png'],
'tiff' => ['pdf', 'jpg', 'png'],
],
'mime_types' => [
'doc' => 'application/msword',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'odt' => 'application/vnd.oasis.opendocument.text',
'rtf' => 'text/rtf',
'txt' => 'text/plain',
'html' => 'text/html',
'xml' => 'text/xml',
'csv' => 'text/csv',
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'xls' => 'application/vnd.ms-excel',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'ppt' => 'application/vnd.ms-powerpoint',
'odp' => 'application/vnd.oasis.opendocument.presentation',
'noscript' => 'image/noscript+xml',
'jpg' => 'image/jpeg',
'png' => 'image/png',
'bmp' => 'image/bmp',
'tiff' => 'image/tiff',
]
],
# ✅ Pros:
✔️ **Easier to modify** – No code changes needed; just edit `config/doxswap.php`.
✔️ **Supports environment overrides** – Can be adjusted dynamically via `.env` or `config()` calls.
✔️ **User-friendly for package consumers** – Developers using my package can **customize it without modifying
Hey r/Laravel community! 👋
A few weeks ago, I launched **Doxswap** (pre-release), a Laravel package for **seamless document conversion** (DOCX → PDF, Markdown → HTML, etc.). The response was **really positive**, and I got **valuable feedback**—especially from this subreddit! 🙌
Now, as I work toward **Doxswap v1**, I’m tackling a design decision:
# 🔍 The Problem
I need a way to **store and validate**:
* **Which conversions are supported** (e.g., DOCX → PDF is valid, but PNG → DOCX is not).
* **MIME types for each format** (e.g., `application/pdf` for PDFs).
* **Easy maintenance & future expansion** (new formats, integrations, etc.).
Right now, I’m debating between **storing this data in a config file (**`config/doxswap.php`**)** or using an **Enum class (**`DocumentFormat::class`**)**. I’d love to hear your thoughts! 🚀
Currently in the pre-release it's all stored in config. But I plan on adding more conversion drivers which could make the doxswap config bloated as I would have to specify support conversions and mime types for each conversion driver.
Option 1: stick with config
'drivers' => [
'libreoffice' => [
'path' => env('LIBRE_OFFICE_PATH', '/usr/bin/soffice'),
'supported_conversions' => [
'doc' => ['pdf', 'docx', 'odt', 'rtf', 'txt', 'html', 'epub', 'xml'],
'docx' => ['pdf', 'odt', 'rtf', 'txt', 'html', 'epub', 'xml'],
'odt' => ['pdf', 'docx', 'doc', 'txt', 'rtf', 'html', 'xml'],
'rtf' => ['pdf', 'docx', 'odt', 'txt', 'html', 'xml'],
'txt' => ['pdf', 'docx', 'odt', 'html', 'xml'],
'html' => ['pdf', 'odt', 'txt'],
'xml' => ['pdf', 'docx', 'odt', 'txt', 'html'],
'csv' => ['pdf', 'xlsx', 'ods', 'html'],
'xlsx' => ['pdf', 'ods', 'csv', 'html'],
'ods' => ['pdf', 'xlsx', 'xls', 'csv', 'html'],
'xls' => ['pdf', 'ods', 'csv', 'html'],
'pptx' => ['pdf', 'odp'],
'ppt' => ['pdf', 'odp'],
'odp' => ['pdf', 'pptx', 'ppt'],
'noscript' => ['pdf', 'png', 'jpg', 'tiff'],
'jpg' => ['pdf', 'png', 'noscript'],
'png' => ['pdf', 'jpg', 'noscript'],
'bmp' => ['pdf', 'jpg', 'png'],
'tiff' => ['pdf', 'jpg', 'png'],
],
'mime_types' => [
'doc' => 'application/msword',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'odt' => 'application/vnd.oasis.opendocument.text',
'rtf' => 'text/rtf',
'txt' => 'text/plain',
'html' => 'text/html',
'xml' => 'text/xml',
'csv' => 'text/csv',
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'xls' => 'application/vnd.ms-excel',
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'ppt' => 'application/vnd.ms-powerpoint',
'odp' => 'application/vnd.oasis.opendocument.presentation',
'noscript' => 'image/noscript+xml',
'jpg' => 'image/jpeg',
'png' => 'image/png',
'bmp' => 'image/bmp',
'tiff' => 'image/tiff',
]
],
# ✅ Pros:
✔️ **Easier to modify** – No code changes needed; just edit `config/doxswap.php`.
✔️ **Supports environment overrides** – Can be adjusted dynamically via `.env` or `config()` calls.
✔️ **User-friendly for package consumers** – Developers using my package can **customize it without modifying
source code**.
# ❌ Cons:
❌ **No strict typing** – You could accidentally pass an unsupported format.
❌ **No IDE auto-completion** – Developers don’t get hints for available formats.
❌ **Can be less performant** – Uses `config()` calls vs. in-memory constants.
Option 2: Using an Enum (`DocumentFormat.php`)
namespace App\Enums;
enum LibreOfficeDocumentFormat: string
{
case DOC = 'doc';
case DOCX = 'docx';
case PDF = 'pdf';
case XLSX = 'xlsx';
case CSV = 'csv';
public static function values(): array
{
return array_column(self::cases(), 'value');
}
public static function isValid(string $format): bool
{
return in_array($format, self::values(), true);
}
}
# ✅ Pros:
✔️ **Strict typing** – Prevents typos and ensures only valid formats are used.
✔️ **IDE auto-completion** – Developers get **hints** when selecting formats.
✔️ **Better performance** – Faster than config files since values are stored in memory.
# ❌ Cons:
❌ **Harder to modify dynamically** – Requires **code changes** to add/remove formats.
❌ **Less user-friendly for package consumers** – They must **extend the Enum** instead of just changing a config file.
❌ **Less flexible for future expansion** – Adding support for new formats requires **code changes** rather than a simple config update.
# 🗳️ What Do You Prefer?
Which approach do you think is **better for a Laravel package**?
Would you prefer a **config file for flexibility** or **an Enum for strict validation**?
The other question is "would anyone even need to modify the config or mime types?"
🚀 Looking forward to hearing your thoughts as I work toward **Doxswap v1!** 🔥
You can check out Doxswap here [https://github.com/Blaspsoft/doxswap](https://github.com/Blaspsoft/doxswap)
https://redd.it/1je2r7v
@r_php
# ❌ Cons:
❌ **No strict typing** – You could accidentally pass an unsupported format.
❌ **No IDE auto-completion** – Developers don’t get hints for available formats.
❌ **Can be less performant** – Uses `config()` calls vs. in-memory constants.
Option 2: Using an Enum (`DocumentFormat.php`)
namespace App\Enums;
enum LibreOfficeDocumentFormat: string
{
case DOC = 'doc';
case DOCX = 'docx';
case PDF = 'pdf';
case XLSX = 'xlsx';
case CSV = 'csv';
public static function values(): array
{
return array_column(self::cases(), 'value');
}
public static function isValid(string $format): bool
{
return in_array($format, self::values(), true);
}
}
# ✅ Pros:
✔️ **Strict typing** – Prevents typos and ensures only valid formats are used.
✔️ **IDE auto-completion** – Developers get **hints** when selecting formats.
✔️ **Better performance** – Faster than config files since values are stored in memory.
# ❌ Cons:
❌ **Harder to modify dynamically** – Requires **code changes** to add/remove formats.
❌ **Less user-friendly for package consumers** – They must **extend the Enum** instead of just changing a config file.
❌ **Less flexible for future expansion** – Adding support for new formats requires **code changes** rather than a simple config update.
# 🗳️ What Do You Prefer?
Which approach do you think is **better for a Laravel package**?
Would you prefer a **config file for flexibility** or **an Enum for strict validation**?
The other question is "would anyone even need to modify the config or mime types?"
🚀 Looking forward to hearing your thoughts as I work toward **Doxswap v1!** 🔥
You can check out Doxswap here [https://github.com/Blaspsoft/doxswap](https://github.com/Blaspsoft/doxswap)
https://redd.it/1je2r7v
@r_php
GitHub
GitHub - Blaspsoft/doxswap: 📄 🔄 Doxswap is a Laravel package for seamless document conversion using LibreOffice. Effortlessly convert…
📄 🔄 Doxswap is a Laravel package for seamless document conversion using LibreOffice. Effortlessly convert DOCX, PDF, ODT, and more with a simple, elegant API. Supports Laravel storage, configurable...
Enums for authorisation
https://laravel-news.com/authorization-backed-enums
I do think being able to use an enum in authorisation checks is an improvement over directly using strings but I’m not sure backed enum are much better.
I’ve not checked, but I suspect that the enum is converted to its backed value rather than using its identity to find the correct check. It feels like a missed opportunity.
https://redd.it/1je4s29
@r_php
https://laravel-news.com/authorization-backed-enums
I do think being able to use an enum in authorisation checks is an improvement over directly using strings but I’m not sure backed enum are much better.
I’ve not checked, but I suspect that the enum is converted to its backed value rather than using its identity to find the correct check. It feels like a missed opportunity.
https://redd.it/1je4s29
@r_php
Laravel News
Enhancing Laravel Authorization with Backed Enums - Laravel News
Enhance your Laravel application's security model with backed enum support for permissions. This feature provides a type-safe approach to authorization checks while improving code readability and maintainability.
Laravel Starter Kit, or Laravel SPA
For SaaS, what's better to use, the laravel starter kit for either Vue or React, or use Laravel with Vue for example as SPA application? I haven't used any of the starter kits, I've only used Laravel wit Vue SPA, what are the advantages of using the starter kit?
I have no experience with Interia
Sorry for the confusion: I meant a SPA with Laravel Sanctum, Pinia and etc, versus the default SPA that are the starter kits
https://redd.it/1je9618
@r_php
For SaaS, what's better to use, the laravel starter kit for either Vue or React, or use Laravel with Vue for example as SPA application? I haven't used any of the starter kits, I've only used Laravel wit Vue SPA, what are the advantages of using the starter kit?
I have no experience with Interia
Sorry for the confusion: I meant a SPA with Laravel Sanctum, Pinia and etc, versus the default SPA that are the starter kits
https://redd.it/1je9618
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
How Much Memory Does A Worker Use?
Yep, I get the logical fallacy here. May as well ask how long is a rope. BUT...I'm wondering from your experience what have you seen as an average in your projects? I'd like to do some basic calculations to estimate how much ram my VPS will need for an upcoming project. Not looking for anything exact, just roughly.
If you would like, you can assume my project will be extensive and lots of features and tools. Complex.
https://redd.it/1jeag1a
@r_php
Yep, I get the logical fallacy here. May as well ask how long is a rope. BUT...I'm wondering from your experience what have you seen as an average in your projects? I'd like to do some basic calculations to estimate how much ram my VPS will need for an upcoming project. Not looking for anything exact, just roughly.
If you would like, you can assume my project will be extensive and lots of features and tools. Complex.
https://redd.it/1jeag1a
@r_php
Should I learn PHP or .NET?
I already know web development with react and next js and I wanted to learn something related backend to upscale myself I don’t want to learn node although I know how it works (don’t know how to code in it) I’m confused between PHP and .NET.
https://redd.it/1jem95k
@r_php
I already know web development with react and next js and I wanted to learn something related backend to upscale myself I don’t want to learn node although I know how it works (don’t know how to code in it) I’m confused between PHP and .NET.
https://redd.it/1jem95k
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Form still submit through live component instead of symfony controller
Where am I doing it wrongly?
I have the live component extends abstract controller with defaultactiontrait and compnentwithformtrait as per documentation and create form via instantiateForm.
Inside symfony controller I have created form as usual and then pass the form to live component via twig as per documentation.
When it rendered first time, the form created in symfony controller is used. But when I submit, it appears live component form is submitted instead.
My impression is there is seperate form instance being created when a refresh is done in live component.
I saw in symfony profile, there r two POST, first one was for symfony controller and second POST was for live component.
https://redd.it/1jeozl1
@r_php
Where am I doing it wrongly?
I have the live component extends abstract controller with defaultactiontrait and compnentwithformtrait as per documentation and create form via instantiateForm.
Inside symfony controller I have created form as usual and then pass the form to live component via twig as per documentation.
When it rendered first time, the form created in symfony controller is used. But when I submit, it appears live component form is submitted instead.
My impression is there is seperate form instance being created when a refresh is done in live component.
I saw in symfony profile, there r two POST, first one was for symfony controller and second POST was for live component.
https://redd.it/1jeozl1
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
Who's hiring/looking
This is a bi-monthly thread aimed to connect PHP companies and developers who are hiring or looking for a job.
Rules
No recruiters
Don't share any personal info like email addresses or phone numbers in this thread. Contact each other via DM to get in touch
If you're hiring: don't just link to an external website, take the time to describe what you're looking for in the thread.
If you're looking: feel free to share your portfolio, GitHub, … as well. Keep into account the personal information rule, so don't just share your CV and be done with it.
https://redd.it/1jesouk
@r_php
This is a bi-monthly thread aimed to connect PHP companies and developers who are hiring or looking for a job.
Rules
No recruiters
Don't share any personal info like email addresses or phone numbers in this thread. Contact each other via DM to get in touch
If you're hiring: don't just link to an external website, take the time to describe what you're looking for in the thread.
If you're looking: feel free to share your portfolio, GitHub, … as well. Keep into account the personal information rule, so don't just share your CV and be done with it.
https://redd.it/1jesouk
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
ddBody, Context Methods & One of Many in Laravel 12.2
https://youtu.be/nozCdZ_AFIs
https://redd.it/1jewjxm
@r_php
https://youtu.be/nozCdZ_AFIs
https://redd.it/1jewjxm
@r_php
YouTube
ddBody, Context Methods & One of Many in Laravel 12.2
What's new in Laravel is back! We share new features of the Laravel framework every week 🙌 (v12.2)
1️⃣ Collection Chunk Without Preserving Keys
https://github.com/laravel/framework/pull/54916
2️⃣ ddBody
https://github.com/laravel/framework/pull/54933…
1️⃣ Collection Chunk Without Preserving Keys
https://github.com/laravel/framework/pull/54916
2️⃣ ddBody
https://github.com/laravel/framework/pull/54933…
Can't Livewire be smart enough to detect Alpinejs is already installed on the project and not install(run) it again?
I've spent 3 hours trying to solve an issue with a volt component today. I had an input with a variable binded with wire:model attribute. And I just couldn't get the variable to change. Every other thing was working on the app though, it successfully created a DB record, but just didn't empty the text input no matter what I did.
Some of the things I tried :
Then I remembered I started this project with Breeze auth (which comes with alpinejs), and then I installed livewire/volt which apparently also runs alpinejs in the background.
I'm 100% aware that this particular case was a skill issue, since simply opening the Dev tools console showed what was causing the error;
But the thing is, I was writing PHP code the whole way. And you don't debug with Dev tools console when you're writing PHP. That's why I wasted 3 hours looking everywhere for a bug except the console.
So, back to my question: is it not possible to add some conditions to check if alpinejs already initialized in the
https://redd.it/1jf3dbc
@r_php
I've spent 3 hours trying to solve an issue with a volt component today. I had an input with a variable binded with wire:model attribute. And I just couldn't get the variable to change. Every other thing was working on the app though, it successfully created a DB record, but just didn't empty the text input no matter what I did.
Some of the things I tried :
$a = $this->pull('string'), $this->reset('string'), and even straight up $this->string = "";Then I remembered I started this project with Breeze auth (which comes with alpinejs), and then I installed livewire/volt which apparently also runs alpinejs in the background.
I'm 100% aware that this particular case was a skill issue, since simply opening the Dev tools console showed what was causing the error;
Detected multiple instances of Alpine runningBut the thing is, I was writing PHP code the whole way. And you don't debug with Dev tools console when you're writing PHP. That's why I wasted 3 hours looking everywhere for a bug except the console.
So, back to my question: is it not possible to add some conditions to check if alpinejs already initialized in the
app.js file, so that both of these first (and almost-first) party Laravel packages wouldn't conflict with each other when installed on a brand new project?https://redd.it/1jf3dbc
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
Best practice for Vue integration
Hey all,
As per noscript, wdyt is the best way to use Vue with Symfony?
I found some old articles and I see Symfony UX explained a little on the website but I would like some insight if anyone has it, or some resources.
Cheers!
https://redd.it/1jf76o6
@r_php
Hey all,
As per noscript, wdyt is the best way to use Vue with Symfony?
I found some old articles and I see Symfony UX explained a little on the website but I would like some insight if anyone has it, or some resources.
Cheers!
https://redd.it/1jf76o6
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
Just pushed v5.0 of Directory Lister, including an official Docker image!
https://github.com/DirectoryLister/DirectoryLister/releases/tag/5.0.0
https://redd.it/1jfa63g
@r_php
https://github.com/DirectoryLister/DirectoryLister/releases/tag/5.0.0
https://redd.it/1jfa63g
@r_php
GitHub
Release v5.0.0 · DirectoryLister/DirectoryLister
Added
Added the ability to list any directory via the FILE_PATH environment variable
Added an official Docker image (available as phlak/directory-lister)
Changed
Bumped minimum required PHP vers...
Added the ability to list any directory via the FILE_PATH environment variable
Added an official Docker image (available as phlak/directory-lister)
Changed
Bumped minimum required PHP vers...
Why doesn't laravel have the concept of router rewriting
A concept found in the zend framework (and i likely others) is route rewriting, so if you had `/products/{product:slug}`, it could be hit with `/{product:slug}` if configured that way.
Its currently impossible to have multiple routes that are a single dynamic parameter, so if i want to have user generated pages such as /about and /foobar created in a cms, and then also have products listed on the site, such as /notebook or /paintbrush, i would have to register each manually, and when the DB updates, trigger 'route:clear' and 'route:cache' again.
Rewrites would be a powerful tool to support this in a really simple way, is there any reasoning why it isnt used, or is this something that would be beneficial to the community?
Edit: to clarify, what i want to have as a mechanism where you can register two separate dynamic routes, without overlapping, so rather than just matching the first one and 404 if the parameter cant be resolved, both would be checked, i have seen router rewriting used to achieve this in other frameworks, but i guess changes to the router itself could achieve this
if i have
and go to /foo, it will match the blog controller, try to find a blog model instance with slug 'foo', and 404 if it doesn't exist, IMO what SHOULD happen, is the parameter resolution happening as part of determining if the route matches or not, so if no blog post is found, it will search for a product with name 'foo', if it finds one match that route, if not keep checking routes.
https://redd.it/1jfc2ao
@r_php
A concept found in the zend framework (and i likely others) is route rewriting, so if you had `/products/{product:slug}`, it could be hit with `/{product:slug}` if configured that way.
Its currently impossible to have multiple routes that are a single dynamic parameter, so if i want to have user generated pages such as /about and /foobar created in a cms, and then also have products listed on the site, such as /notebook or /paintbrush, i would have to register each manually, and when the DB updates, trigger 'route:clear' and 'route:cache' again.
Rewrites would be a powerful tool to support this in a really simple way, is there any reasoning why it isnt used, or is this something that would be beneficial to the community?
Edit: to clarify, what i want to have as a mechanism where you can register two separate dynamic routes, without overlapping, so rather than just matching the first one and 404 if the parameter cant be resolved, both would be checked, i have seen router rewriting used to achieve this in other frameworks, but i guess changes to the router itself could achieve this
if i have
Route::get('/{blog:slug}', [BlogController::class, 'show']);Route::get('/{product:name}', [ProductsController::class, 'pdp']);and go to /foo, it will match the blog controller, try to find a blog model instance with slug 'foo', and 404 if it doesn't exist, IMO what SHOULD happen, is the parameter resolution happening as part of determining if the route matches or not, so if no blog post is found, it will search for a product with name 'foo', if it finds one match that route, if not keep checking routes.
https://redd.it/1jfc2ao
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
Why doesn't laravel have the concept of router rewriting
A concept found in the zend framework (and i likely others) is route rewriting, so if you had `/products/{product:slug}`, it could be hit with `/{product:slug}` if configured that way.
Its currently impossible to have multiple routes that are a single dynamic parameter, so if i want to have user generated pages such as /about and /foobar created in a cms, and then also have products listed on the site, such as /notebook or /paintbrush, i would have to register each manually, and when the DB updates, trigger 'route:clear' and 'route:cache' again.
Rewrites would be a powerful tool to support this in a really simple way, is there any reasoning why it isnt used, or is this something that would be beneficial to the community?
Edit: to clarify, what i want to have as a mechanism where you can register two separate dynamic routes, without overlapping, so rather than just matching the first one and 404 if the parameter cant be resolved, both would be checked, i have seen router rewriting used to achieve this in other frameworks, but i guess changes to the router itself could achieve this
if i have
and go to /foo, it will match the blog controller, try to find a blog model instance with slug 'foo', and 404 if it doesn't exist, IMO what SHOULD happen, is the parameter resolution happening as part of determining if the route matches or not, so if no blog post is found, it will search for a product with name 'foo', if it finds one match that route, if not keep checking routes.
https://redd.it/1jfc6qi
@r_php
A concept found in the zend framework (and i likely others) is route rewriting, so if you had `/products/{product:slug}`, it could be hit with `/{product:slug}` if configured that way.
Its currently impossible to have multiple routes that are a single dynamic parameter, so if i want to have user generated pages such as /about and /foobar created in a cms, and then also have products listed on the site, such as /notebook or /paintbrush, i would have to register each manually, and when the DB updates, trigger 'route:clear' and 'route:cache' again.
Rewrites would be a powerful tool to support this in a really simple way, is there any reasoning why it isnt used, or is this something that would be beneficial to the community?
Edit: to clarify, what i want to have as a mechanism where you can register two separate dynamic routes, without overlapping, so rather than just matching the first one and 404 if the parameter cant be resolved, both would be checked, i have seen router rewriting used to achieve this in other frameworks, but i guess changes to the router itself could achieve this
if i have
Route::get('/{blog:slug}', [BlogController::class, 'show']);Route::get('/{product:name}', [ProductsController::class, 'pdp']);and go to /foo, it will match the blog controller, try to find a blog model instance with slug 'foo', and 404 if it doesn't exist, IMO what SHOULD happen, is the parameter resolution happening as part of determining if the route matches or not, so if no blog post is found, it will search for a product with name 'foo', if it finds one match that route, if not keep checking routes.
https://redd.it/1jfc6qi
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Cross-Language Queues: Sending Jobs from Node.js to Laravel - blog.thms.uk
https://blog.thms.uk/2025/03/laravel-queue-nodejs?utm_source=reddit
https://redd.it/1jfiwyb
@r_php
https://blog.thms.uk/2025/03/laravel-queue-nodejs?utm_source=reddit
https://redd.it/1jfiwyb
@r_php
blog.thms.uk
Cross-Language Queues: Sending Jobs from Node.js to Laravel - blog.thms.uk
Did you know you can push jobs into a Laravel queue from outside your application? Whether you're offloading tasks from a Node.js service or integrating Laravel with external systems, queues make it easy to handle background processing efficiently. In this…
Laravel 12 Multi Authentication with Starter Kit
https://youtu.be/jS86bTjx-KI?si=WsNsrXhmVQmUT3IP
https://redd.it/1jfirju
@r_php
https://youtu.be/jS86bTjx-KI?si=WsNsrXhmVQmUT3IP
https://redd.it/1jfirju
@r_php
YouTube
Laravel 12 Multi Auth with Starter Kit
In this video, we will learn how to add multiple authentications with the laravel 12 application.
#laravel #laravel12 #auth #multi #itsolutionstuff
#laravel #laravel12 #auth #multi #itsolutionstuff
Google Cloud Pub Sub Multiple Subnoscriptions
Hey everyone,
At my work, we run a Symfony 7.2 app within Google Cloud, and we have an in-house written process that will pull from the various subnoscriptions we have and process messages.
I've now been tasked with rewriting this and integrating it into Symfony Messenger. That challenge is that for ... reasons (https://github.com/symfony/symfony/issues/44635), Symfony Devs refuse to write an integration for Messenger.
This leaves me looking at packages like petit press messenger https://github.com/petitpress/gps-messenger-bundle, however I have 2 basic requirements:
It must support multiple topics/subnoscriptions
I must have the option of cycling through the subnoscriptions and pulling messages, like a round robin. (So pull 10 from Sub A, 10 from Sub B etc)
Petit Messenger doesn't do either of these as far as I can tell, so was part way through writing my own.
I guess the challenge with this will be how I link a message back to a queue to be able to acknowledge it.
Just wondering if anyone else has had to do something similar, and what was your solution.
Cheers
https://redd.it/1jfk21i
@r_php
Hey everyone,
At my work, we run a Symfony 7.2 app within Google Cloud, and we have an in-house written process that will pull from the various subnoscriptions we have and process messages.
I've now been tasked with rewriting this and integrating it into Symfony Messenger. That challenge is that for ... reasons (https://github.com/symfony/symfony/issues/44635), Symfony Devs refuse to write an integration for Messenger.
This leaves me looking at packages like petit press messenger https://github.com/petitpress/gps-messenger-bundle, however I have 2 basic requirements:
It must support multiple topics/subnoscriptions
I must have the option of cycling through the subnoscriptions and pulling messages, like a round robin. (So pull 10 from Sub A, 10 from Sub B etc)
Petit Messenger doesn't do either of these as far as I can tell, so was part way through writing my own.
I guess the challenge with this will be how I link a message back to a queue to be able to acknowledge it.
Just wondering if anyone else has had to do something similar, and what was your solution.
Cheers
https://redd.it/1jfk21i
@r_php
GitHub
[Messenger] Support Google Pub/Sub transport · Issue #44635 · symfony/symfony
Denoscription Pub/Sub is a queueing service of Google Cloud. Pub/Sub combines the horizontal scalability of Apache Kafka and Pulsar with features found in traditional messaging middleware like Apache...
SymfonyLive Paris 2025: See you next week!
https://symfony.com/blog/symfonylive-paris-2025-see-you-next-week?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1jfqvfc
@r_php
https://symfony.com/blog/symfonylive-paris-2025-see-you-next-week?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1jfqvfc
@r_php
Symfony
SymfonyLive Paris 2025: See you next week! (Symfony Blog)
See you next week at SymfonyLive Paris 2025! Get ready for inspiring talks, hands-on workshops, and great moments with the Symfony and PHP community. Don't miss it!
Scaling PHP for Real-World Applications: Seeking Your Feedback on My Newsletter
As the noscript says, I'm looking for feedback and critique. Every year we hear from someone about the fictional death of the immortal PHP =). But as a CTO specializing in PHP refactoring, I see its immense potential for scaling. I've launched a “PHP at Scale” newsletter — my monthly deep dive into best practices, architecture patterns, and real-world use cases of PHP in large, complex applications. https://phpatscale.substack.com
Getting meaningful critique and improvement suggestions is hard as you start a newsletter like this, so I hope you guys can get me some. The idea for this newsletter is to help the community, so I will value any ideas or opinions.
As of right now, my newsletter has 7 issues, some of the topics I’ve tried to cover practically:
PHP's place in the modern web development scene
Keeping code-base up-to-date
Day-to-day rules we can follow to improve our code
Improving performance
Documentation
My interview with Roman Pronskiy (CEO of the PHP Foundation) + some business perspective on PHP
Specific Questions for Your Feedback:
What are the most significant scaling challenges you're currently facing in your PHP projects?
Are there any specific architecture patterns or best practices related to PHP scaling that you would be most interested in reading about in the newsletter?
Are there any specific topics you would like covered in future issues?
What is your preferred newsletter length and frequency?
I value your insights and opinions. Hope you’ll find something useful for yourself in my newsletter, if you do - consider subscribing.
https://redd.it/1jfs9m1
@r_php
As the noscript says, I'm looking for feedback and critique. Every year we hear from someone about the fictional death of the immortal PHP =). But as a CTO specializing in PHP refactoring, I see its immense potential for scaling. I've launched a “PHP at Scale” newsletter — my monthly deep dive into best practices, architecture patterns, and real-world use cases of PHP in large, complex applications. https://phpatscale.substack.com
Getting meaningful critique and improvement suggestions is hard as you start a newsletter like this, so I hope you guys can get me some. The idea for this newsletter is to help the community, so I will value any ideas or opinions.
As of right now, my newsletter has 7 issues, some of the topics I’ve tried to cover practically:
PHP's place in the modern web development scene
Keeping code-base up-to-date
Day-to-day rules we can follow to improve our code
Improving performance
Documentation
My interview with Roman Pronskiy (CEO of the PHP Foundation) + some business perspective on PHP
Specific Questions for Your Feedback:
What are the most significant scaling challenges you're currently facing in your PHP projects?
Are there any specific architecture patterns or best practices related to PHP scaling that you would be most interested in reading about in the newsletter?
Are there any specific topics you would like covered in future issues?
What is your preferred newsletter length and frequency?
I value your insights and opinions. Hope you’ll find something useful for yourself in my newsletter, if you do - consider subscribing.
https://redd.it/1jfs9m1
@r_php
Substack
PHP at Scale | Michał Kurzeja | Substack
Everything about great PHP code.
Powered by accesto.com. Click to read PHP at Scale, by Michał Kurzeja, a Substack publication with thousands of subscribers.
Powered by accesto.com. Click to read PHP at Scale, by Michał Kurzeja, a Substack publication with thousands of subscribers.
Need Better Custom IDs in Laravel? Check Out Laravel ID Generator! 🚀
https://preview.redd.it/72c4ppqpzwpe1.png?width=1738&format=png&auto=webp&s=82f5f0a5fb2e6b2fabcbb7c34575b89adf0a6ffd
We’ve all been there—working on a Laravel project and realizing that auto-incremented IDs or UUIDs just don’t cut it. Whether it’s for invoices, orders, or any structured numbering system, we need something better.
So, I built Laravel ID Generator—a simple yet powerful package that makes generating structured, readable, and customizable IDs effortless!
✨ Features:
✔️ Unique IDs with custom prefixes, suffixes, dates, and more
✔️ Seamless integration with Eloquent models
✔️ Ideal for invoices, receipts, orders (e.g.,
✔️ Flexible & requires zero configuration
🔗 GitHub Repo: https://github.com/omaressaouaf/laravel-id-generator
If you’re working with Laravel and need better ID management, check it out! Would love your thoughts, feedback, or contributions. 🚀
https://redd.it/1jg0dm9
@r_php
https://preview.redd.it/72c4ppqpzwpe1.png?width=1738&format=png&auto=webp&s=82f5f0a5fb2e6b2fabcbb7c34575b89adf0a6ffd
We’ve all been there—working on a Laravel project and realizing that auto-incremented IDs or UUIDs just don’t cut it. Whether it’s for invoices, orders, or any structured numbering system, we need something better.
So, I built Laravel ID Generator—a simple yet powerful package that makes generating structured, readable, and customizable IDs effortless!
✨ Features:
✔️ Unique IDs with custom prefixes, suffixes, dates, and more
✔️ Seamless integration with Eloquent models
✔️ Ideal for invoices, receipts, orders (e.g.,
INV-0005/2025) ✔️ Flexible & requires zero configuration
🔗 GitHub Repo: https://github.com/omaressaouaf/laravel-id-generator
If you’re working with Laravel and need better ID management, check it out! Would love your thoughts, feedback, or contributions. 🚀
https://redd.it/1jg0dm9
@r_php