Does Facade in Laravel implements Facade or Proxy Pattern? Does Facade in Laravel implements Facade or Proxy Pattern? laravel laravel

Does Facade in Laravel implements Facade or Proxy Pattern?


The book, Architect's Guide to PHP Design Patterns notes,

The purpose of the Facade is to present a simpler interface to an entire sub-system composed of many objects.

At my understanding, design patterns are not a "priori" obligation but rather a commitment to implement a general reusable solution to a commonly occurring problem.

Laravel 4 takes advantage of the Facade Design Pattern, which allows it to provide an expressive syntax through a static API but still keep it testable under the hood. The Facade hides the complexity / implementation of the code. Indeed, Laravel's Facades implement a single object. We shouldn't neglect though that Laravel's App Facade (an IoC container) encapsulates the whole application .

A Proxy pattern intercepts a request and does extra work, for instance: filtering, ACL, transformation... The "consumer" Object is blissfully unaware of that extra work provided by the Proxy layer.