Weekly /r/Laravel Help Thread
Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:
What steps have you taken so far?
What have you tried from the documentation?
Did you provide any error messages you are getting?
Are you able to provide instructions to replicate the issue?
Did you provide a code example?
Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.
For more immediate support, you can ask in the official Laravel Discord.
Thanks and welcome to the r/Laravel community!
https://redd.it/1n4zy53
@r_php
Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:
What steps have you taken so far?
What have you tried from the documentation?
Did you provide any error messages you are getting?
Are you able to provide instructions to replicate the issue?
Did you provide a code example?
Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.
For more immediate support, you can ask in the official Laravel Discord.
Thanks and welcome to the r/Laravel community!
https://redd.it/1n4zy53
@r_php
Laravel
Installation - Laravel 12.x - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
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/1n5dv9t
@r_php
Feel free to ask any questions you think may not warrant a post. Asking for help here is also fine.
https://redd.it/1n5dv9t
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
PHP 8.5 introduces a new flag called
So, here’s how you would typically validate an email address without the new flag:
As you can see, you have to manually check the return value and handle the failure.
With the new
Read more
https://redd.it/1n5gfms
@r_php
FILTER_THROW_ON_FAILURE, which, when used, causes the filter function to automatically throw an exception if validation fails, instead of returning false or null.So, here’s how you would typically validate an email address without the new flag:
if (filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
return false;
}
As you can see, you have to manually check the return value and handle the failure.
With the new
FILTER_THROW_ON_FAILURE flag, you can simplify this: try {
filter_var($email, FILTER_VALIDATE_EMAIL, FILTER_THROW_ON_FAILURE);
return true;
} catch (\Filter\FilterFailedException $e) {
return false;
}
Read more
https://redd.it/1n5gfms
@r_php
Amit Merchant
Everything that is coming in PHP 8.5
As every year, we will have the new version of PHP this year too, which is PHP 8.5. It’s the minor version in the PHP 8 line, and the version will be released later this year. Let’s discuss everything that has been added in PHP 8.5 so far.
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/1n5gukf
@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/1n5gukf
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Symfony Rate Limiter Issue (Maybe?)
I've used this limiter in a few projects and it works as expected by autowiring it in the controller, no problems there.
I wanted to use it as a standalone component within a custom validator. That aside for now, to replicate the issue i am having, if you add this to a controller:
use Symfony\Component\RateLimiter\Storage\InMemoryStorage;
use Symfony\Component\RateLimiter\RateLimiterFactory;
^^^ Remember to add these.
$factory = new RateLimiterFactory(
'id' => 'login',
'policy' => 'token_bucket',
'limit' => 3,
'rate' => ['interval' => '15 minutes',
], new InMemoryStorage());
$limiter = $factory->create();
$limit = $limiter->consume(1);
if (!$limit->isAccepted()) {
dd('limit hit');
}
dd($limit->getRemainingTokens());
Github Repo: https://github.com/symfony/rate-limiter
The above code is in the README of the repo. What i would expect on every refresh is the remaining tokens to count down then hit the limit but this will always show 2 remaining.
From looking at it, the storage is getting renewed every time and not persistent, but this is the "Getting started" code...
What am i doing wrong?
https://redd.it/1n5lw6k
@r_php
I've used this limiter in a few projects and it works as expected by autowiring it in the controller, no problems there.
I wanted to use it as a standalone component within a custom validator. That aside for now, to replicate the issue i am having, if you add this to a controller:
use Symfony\Component\RateLimiter\Storage\InMemoryStorage;
use Symfony\Component\RateLimiter\RateLimiterFactory;
^^^ Remember to add these.
$factory = new RateLimiterFactory(
'id' => 'login',
'policy' => 'token_bucket',
'limit' => 3,
'rate' => ['interval' => '15 minutes',
], new InMemoryStorage());
$limiter = $factory->create();
$limit = $limiter->consume(1);
if (!$limit->isAccepted()) {
dd('limit hit');
}
dd($limit->getRemainingTokens());
Github Repo: https://github.com/symfony/rate-limiter
The above code is in the README of the repo. What i would expect on every refresh is the remaining tokens to count down then hit the limit but this will always show 2 remaining.
From looking at it, the storage is getting renewed every time and not persistent, but this is the "Getting started" code...
What am i doing wrong?
https://redd.it/1n5lw6k
@r_php
GitHub
GitHub - symfony/rate-limiter: Provides a Token Bucket implementation to rate limit input and output in your application
Provides a Token Bucket implementation to rate limit input and output in your application - symfony/rate-limiter
Stray Requests, Merge Functions & Markdown Button Added in Laravel 12.25
https://youtu.be/oWwTNtgjp6w
https://redd.it/1n5qnv7
@r_php
https://youtu.be/oWwTNtgjp6w
https://redd.it/1n5qnv7
@r_php
YouTube
Stray Requests, Merge Functions & Markdown Button Added in Laravel 12.25
"What's new in Laravel is back! We share new features of the Laravel framework every week 🙌 (v12.25.)"
1️⃣ Allow stray requests
https://github.com/laravel/framework/pull/56645
2️⃣ New merge* methods added
https://github.com/laravel/framework/pull/56678…
1️⃣ Allow stray requests
https://github.com/laravel/framework/pull/56645
2️⃣ New merge* methods added
https://github.com/laravel/framework/pull/56678…
An alternative approach to Laravel route localization
Hey r/laravel, 👋
I'd like to share the package I've been working on. https://github.com/goodcat-dev/laravel-l10n
The core idea is to define localized routes and route translations directly in your
Route::get('{lang}/example', Controller::class)
->lang(
'fr', 'de',
'it' => 'it/esempio',
'es' => 'es/ejemplo'
);
This single route definition handles:
`/{lang}/example` for French `fr/example` and German `de/example`.
Translated routes
`/example` for English, the default locale.
The main features I focused on were:
All route definitions in one place, with no need for separate translation files.
Automatically generates the correct URL for the active locale with the standard `route()` helper.
Automatically looks for locale-specific view files (e.g. views/es/example.blade.php) and falls back to the generic view if no localized version is found.
A mechanism to detect a user's preferred language based on the `Accept-Language` header and model that implements the `HasLocalePreference` interface.
No custom
This package is still experimental, so there may be some bugs. I'd like to hear your thoughts on this approach to localization. What do you think?
You can check it out here: https://github.com/goodcat-dev/laravel-l10n
https://redd.it/1n5rhrf
@r_php
Hey r/laravel, 👋
I'd like to share the package I've been working on. https://github.com/goodcat-dev/laravel-l10n
The core idea is to define localized routes and route translations directly in your
routes/web.php file using the Route::lang() method. Here's an example:Route::get('{lang}/example', Controller::class)
->lang(
'fr', 'de',
'it' => 'it/esempio',
'es' => 'es/ejemplo'
);
This single route definition handles:
`/{lang}/example` for French `fr/example` and German `de/example`.
Translated routes
it/esempio, es/ejemplo.`/example` for English, the default locale.
The main features I focused on were:
All route definitions in one place, with no need for separate translation files.
Automatically generates the correct URL for the active locale with the standard `route()` helper.
Automatically looks for locale-specific view files (e.g. views/es/example.blade.php) and falls back to the generic view if no localized version is found.
A mechanism to detect a user's preferred language based on the `Accept-Language` header and model that implements the `HasLocalePreference` interface.
No custom
route:cache command required.This package is still experimental, so there may be some bugs. I'd like to hear your thoughts on this approach to localization. What do you think?
You can check it out here: https://github.com/goodcat-dev/laravel-l10n
https://redd.it/1n5rhrf
@r_php
GitHub
GitHub - goodcat-dev/laravel-l10n: An opinionated Laravel package for app localization
An opinionated Laravel package for app localization - goodcat-dev/laravel-l10n
SheafUI: A 100% free Laravel Blade UI platform with CLI install, 33+ components, and full code ownership
We just released **SheafUI**, an open-source UI platform for Laravel developers.
The philosophy is simple:
* **Your code should be yours** : every component you install is native Blade + Alpine, copied into your project (no vendor lock) and supportable both alpine and livewire.
* **No copy-paste:** install with one command using the SheafUI CLI.
* **All free:** 33+ components today, with more coming soon.
Example:
php artisan sheaf:init
php artisan sheaf:install button
After that, the component lives in resources/views/components/ui/, fully editable and owned by you.
Website: [sheafui.dev](http://sheafui.dev)
CLI repository: [https://github.com/sheafui/cli](https://github.com/sheafui/cli)
Components repository: [https://github.com/sheafui/components](https://github.com/sheafui/components)
We’d love feedback from the Laravel community, which components would you like to see added next?
https://redd.it/1n5uax5
@r_php
We just released **SheafUI**, an open-source UI platform for Laravel developers.
The philosophy is simple:
* **Your code should be yours** : every component you install is native Blade + Alpine, copied into your project (no vendor lock) and supportable both alpine and livewire.
* **No copy-paste:** install with one command using the SheafUI CLI.
* **All free:** 33+ components today, with more coming soon.
Example:
php artisan sheaf:init
php artisan sheaf:install button
After that, the component lives in resources/views/components/ui/, fully editable and owned by you.
Website: [sheafui.dev](http://sheafui.dev)
CLI repository: [https://github.com/sheafui/cli](https://github.com/sheafui/cli)
Components repository: [https://github.com/sheafui/components](https://github.com/sheafui/components)
We’d love feedback from the Laravel community, which components would you like to see added next?
https://redd.it/1n5uax5
@r_php
sheafui.dev
Sheaf UI - Modern laravel and livewire Components
Sheaf UI provides Laravel/Livewire components with code that's you own, designed for elegance, speed, and accessibility.
Laravel Deployment on multi-project server
I manage a Hetzner server running three Laravel projects under HestiaCP and Debian.
Right now deployments run from a GitHub Actions workflow that uses SSH into the server and runs a remote deploy noscript whenever a PR is merged.
This works but doesn’t scale.
What deployment strategy would you recommend for a multi-project server like this?
https://redd.it/1n5xhst
@r_php
I manage a Hetzner server running three Laravel projects under HestiaCP and Debian.
Right now deployments run from a GitHub Actions workflow that uses SSH into the server and runs a remote deploy noscript whenever a PR is merged.
This works but doesn’t scale.
What deployment strategy would you recommend for a multi-project server like this?
https://redd.it/1n5xhst
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
Config mixture: the Laravel way
I’m trying to add an external config source to my project. This config source I can access over HTTP. However, I would like to keep using config() to access configuration values.
On top of that, the values that I receive from the external source might be a reference to some env() value or another key in that external source.
Env values I have are coming either from .env file or OS.
So, I have a mixture of everything here.
What is THE Laravel way to configure such configuration sources?
https://redd.it/1n629rt
@r_php
I’m trying to add an external config source to my project. This config source I can access over HTTP. However, I would like to keep using config() to access configuration values.
On top of that, the values that I receive from the external source might be a reference to some env() value or another key in that external source.
Env values I have are coming either from .env file or OS.
So, I have a mixture of everything here.
What is THE Laravel way to configure such configuration sources?
https://redd.it/1n629rt
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
Laravel Starter Kits List: Official and Community
https://nabilhassen.com/laravel-starter-kits-list-official-and-community
https://redd.it/1n6cswd
@r_php
https://nabilhassen.com/laravel-starter-kits-list-official-and-community
https://redd.it/1n6cswd
@r_php
Nabilhassen
Laravel Starter Kits List: Official and Community
Explore the complete list of Laravel starter kits, both official and community. Compare features and find the right kit to speed up your Laravel projects.
What SAST/DAST Tools Work for you?
Even devs who know the OWASP Top 10 by heart can still write vulnerable code. SQL injections, XSS, IDOR - you name it — mistakes happen. That’s where tools like SAST and DAST come in, and I’m curious about what’s working for the community.
In my latest newsletter, I mentioned tools like Composer audit, Psalm, and PHPStan for catching issues early, and Trivy or Hadolint for infrastructure-level checks. I’ve also seen commercial options like Snyk or Sonar’s RIPS, but I’ve found them hit-or-miss with false positives or missing real issues. So far, none of the tools made me feel really safe, so I’m wondering: what SAST or DAST tools do you rely on in your PHP projects? Are there any you can recommend?
https://redd.it/1n6e8hq
@r_php
Even devs who know the OWASP Top 10 by heart can still write vulnerable code. SQL injections, XSS, IDOR - you name it — mistakes happen. That’s where tools like SAST and DAST come in, and I’m curious about what’s working for the community.
In my latest newsletter, I mentioned tools like Composer audit, Psalm, and PHPStan for catching issues early, and Trivy or Hadolint for infrastructure-level checks. I’ve also seen commercial options like Snyk or Sonar’s RIPS, but I’ve found them hit-or-miss with false positives or missing real issues. So far, none of the tools made me feel really safe, so I’m wondering: what SAST or DAST tools do you rely on in your PHP projects? Are there any you can recommend?
https://redd.it/1n6e8hq
@r_php
Substack
PHP at Scale #12
This month, I would like to focus on security. In recent weeks, I have seen major negligence in this area in a couple of projects.
SymfonyCon Amsterdam 2025: Practical AI Integrations with Symfony
https://symfony.com/blog/symfonycon-amsterdam-2025-practical-ai-integrations-with-symfony?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1n6k354
@r_php
https://symfony.com/blog/symfonycon-amsterdam-2025-practical-ai-integrations-with-symfony?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1n6k354
@r_php
Symfony
SymfonyCon Amsterdam 2025: Practical AI Integrations with Symfony (Symfony Blog)
In his talk, Christopher Hertel cuts through the AI buzz to show you real, actionable ways to bring AI-powered features, far beyond chatbots, into your PHP applications and scalable architectures.
Why --dump-sql still outputs sql despite being executed?
In the server I've run:
```
$ php bin/console doctrine:schema:update --force
Updating database schema...
93 queries were executed
[OK\] Database schema updated successfully!
```
But once I executed the sql above once I run:
```
$ php bin/console doctrine:schema:update --dump-sql | head
ALTER TABLE xxx1 CHANGE expires_at expires_at DATETIME DEFAULT NULL, CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL;
ALTER TABLE xx2 CHANGE name name VARCHAR(255) DEFAULT NULL, CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL, CHANGE unique_identifier unique_identifier VARCHAR(255) DEFAULT NULL;
ALTER TABLE xx3 CHANGE denoscription denoscription VARCHAR(255) DEFAULT NULL, CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL, CHANGE unique_identifier unique_identifier VARCHAR(255) DEFAULT NULL;
.....
```
Even if I execute manually:
```
LTER TABLE xxx1 CHANGE expires_at expires_at DATETIME DEFAULT NULL, CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL;
```
`doctrine:schema:update` would output it once more why???
https://redd.it/1n6l2xm
@r_php
In the server I've run:
```
$ php bin/console doctrine:schema:update --force
Updating database schema...
93 queries were executed
[OK\] Database schema updated successfully!
```
But once I executed the sql above once I run:
```
$ php bin/console doctrine:schema:update --dump-sql | head
ALTER TABLE xxx1 CHANGE expires_at expires_at DATETIME DEFAULT NULL, CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL;
ALTER TABLE xx2 CHANGE name name VARCHAR(255) DEFAULT NULL, CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL, CHANGE unique_identifier unique_identifier VARCHAR(255) DEFAULT NULL;
ALTER TABLE xx3 CHANGE denoscription denoscription VARCHAR(255) DEFAULT NULL, CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL, CHANGE deleted_at deleted_at DATETIME DEFAULT NULL, CHANGE unique_identifier unique_identifier VARCHAR(255) DEFAULT NULL;
.....
```
Even if I execute manually:
```
LTER TABLE xxx1 CHANGE expires_at expires_at DATETIME DEFAULT NULL, CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL;
```
`doctrine:schema:update` would output it once more why???
https://redd.it/1n6l2xm
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
New toPrettyJson & withHeartbeat Features in Laravel 12.26
https://youtu.be/4mG3ekksG3s
https://redd.it/1n6l57b
@r_php
https://youtu.be/4mG3ekksG3s
https://redd.it/1n6l57b
@r_php
YouTube
New toPrettyJson & withHeartbeat Features in Laravel 12.26
What's new in Laravel is back! We share new features of the Laravel framework every week 🙌 (v12.26)
1️⃣ Add toPrettyJson method
https://github.com/laravel/framework/pull/56697
2️⃣ Add withHeartbeat to LazyCollection
https://github.com/laravel/framework/pull/56477…
1️⃣ Add toPrettyJson method
https://github.com/laravel/framework/pull/56697
2️⃣ Add withHeartbeat to LazyCollection
https://github.com/laravel/framework/pull/56477…
Would like to get some feedback on my first Symfony project!
Hey everyone, I wanted to learn symfony so I started working on a toy project - a self hosted filesystem app (like gdrive). It exposes an API for authentication and CRUD operations on files. I also used twig to build a small admin dashboard UI.
Need to mention, the project is not yet finished, I need to add a file sharing option and possibly some tests, and maybe the fronted (though the frontend is irrelevant for this), but it is a good time to get other's opinion on this.
I would love to get some feedback, especially on API design, security/authentication flow. Also this is the first time I used docker so I would appreciate some pointers for this too (are the containers structured well, is it good for easy self hosting?)
Also what improvements could I make to the project?
Thanks!
The project is available on github. Api docs is here
https://redd.it/1n6rhcb
@r_php
Hey everyone, I wanted to learn symfony so I started working on a toy project - a self hosted filesystem app (like gdrive). It exposes an API for authentication and CRUD operations on files. I also used twig to build a small admin dashboard UI.
Need to mention, the project is not yet finished, I need to add a file sharing option and possibly some tests, and maybe the fronted (though the frontend is irrelevant for this), but it is a good time to get other's opinion on this.
I would love to get some feedback, especially on API design, security/authentication flow. Also this is the first time I used docker so I would appreciate some pointers for this too (are the containers structured well, is it good for easy self hosting?)
Also what improvements could I make to the project?
Thanks!
The project is available on github. Api docs is here
https://redd.it/1n6rhcb
@r_php
GitHub
GitHub - darusc/Fileknight
Contribute to darusc/Fileknight development by creating an account on GitHub.
Been seeing more PHP gigs out there.
It seems like PHP gigs are coming out of hiding. This leads me to think of a great marketing slogan PHP:
PHP is like a Volvo or a Honda.... it's not sexy, but it is reliable, affordable, and it delivers what you need when you need it.
https://redd.it/1n6s3bf
@r_php
It seems like PHP gigs are coming out of hiding. This leads me to think of a great marketing slogan PHP:
PHP is like a Volvo or a Honda.... it's not sexy, but it is reliable, affordable, and it delivers what you need when you need it.
https://redd.it/1n6s3bf
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Would like to get some feedback on my first Symfony project!
Hey everyone, I wanted to learn symfony so I started working on a toy project - a self hosted filesystem app (like gdrive). It exposes an API for authentication and CRUD operations on files. I also used twig to build a small admin dashboard UI.
Need to mention, the project is not yet finished, I need to add a file sharing option and possibly some tests, and maybe the fronted (though the frontend is irrelevant for this), but it is a good time to get other's opinion on this.
I would love to get some feedback, especially on API design, security/authentication flow. Also this is the first time I used docker so I would appreciate some pointers for this too (are the containers structured well, is it good for easy self hosting?)
Also what improvements could I make to the project?
Thanks!
The project is available on [github\](https://github.com/darusc/Fileknight). Api docs is [here\](https://github.com/darusc/Fileknight/blob/main/API.md)
https://redd.it/1n6rhyn
@r_php
Hey everyone, I wanted to learn symfony so I started working on a toy project - a self hosted filesystem app (like gdrive). It exposes an API for authentication and CRUD operations on files. I also used twig to build a small admin dashboard UI.
Need to mention, the project is not yet finished, I need to add a file sharing option and possibly some tests, and maybe the fronted (though the frontend is irrelevant for this), but it is a good time to get other's opinion on this.
I would love to get some feedback, especially on API design, security/authentication flow. Also this is the first time I used docker so I would appreciate some pointers for this too (are the containers structured well, is it good for easy self hosting?)
Also what improvements could I make to the project?
Thanks!
The project is available on [github\](https://github.com/darusc/Fileknight). Api docs is [here\](https://github.com/darusc/Fileknight/blob/main/API.md)
https://redd.it/1n6rhyn
@r_php
GitHub
GitHub - darusc/Fileknight
Contribute to darusc/Fileknight development by creating an account on GitHub.
What would be the feature of PHP 9.0 that you would like the most?
I did not make a research of PHP 9.0 roadmap. I am just curious.
What feature you would like to have there the most?
https://redd.it/1n78l27
@r_php
I did not make a research of PHP 9.0 roadmap. I am just curious.
What feature you would like to have there the most?
https://redd.it/1n78l27
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
SymfonyCon Amsterdam 2025: Make your AI useful with MCP
https://symfony.com/blog/symfonycon-amsterdam-2025-make-your-ai-useful-with-mcp?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1n7cp2c
@r_php
https://symfony.com/blog/symfonycon-amsterdam-2025-make-your-ai-useful-with-mcp?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1n7cp2c
@r_php
Symfony
SymfonyCon Amsterdam 2025: Make your AI useful with MCP (Symfony Blog)
Turn your LLM into a truly helpful assistant with Tobias Nyholm. Discover how the MCP protocol makes AI answer your real questions, not just generic ones.