Description

It’s possible to deprecate service aliases

Syntax

# config/services.yaml
services:
    # ...
 
    app.mailer:
        alias: App\Mail\PhpMailer
        deprecated: ~

Custom error message

# config/services.yaml
services:
  # ...
 
  app.mailer:
    alias: App\Mail\PhpMailer
    deprecated: 'The "%alias_id%" service alias is deprecated.'