Обложка канала

Amazing PHP

8898 @phpme

Welcome to the Amazing PHP Channel!Here you can find a lot of interesting articles/news about PHP, frameworks, tools and development.

Amazing PHP

7 лет назад
Открыть в
Service locator: an anti-pattern
As a Laravel developer, I'm confronted daily with the service locator pattern. Every facade call and several helper functions are built upon it.

Let's take a look at a common facade call: Auth::user(). The Auth facade will reach into Laravel's service container, grab the registered component, and forward the static call to that component. In this case, it'll return the logged in user.