@kadin
To override an autowired service in Symfony, you can follow these steps:
1 2 3 4 5 6 |
use AppServiceOriginalService; class OverriddenService extends OriginalService { // custom implementation } |
1 2 3 |
services: AppServiceOriginalService: class: AppServiceOverriddenService |
1
|
bin/console cache:clear |
After performing the above steps, whenever you autowire the original service in your code, Symfony will use the overridden service instead.