We’re here again for another design pattern example! This pattern lets you add new features or behaviours to existing classes without modifying the main class.

Imagine we are building a CRM and we are required to add logging functionality into our application.

Another when a user logs in to the application, we are required to log it into a file and into a database log table.

We only have to set it up in our “service container” the correct instantiation of decorators!
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners