4 ms·
> it is built around static methods instead of proper OOP The fake case against Laravel that never dies . The truth is found in the docs: https://laravel.com/d
by dabernathy89 7y ago
> it is built around static methods instead of proper OOP
The fake case against Laravel that never dies . The truth is found in the docs: https://laravel.com/docs/5.8/facades https://laravel.com/docs/5.8/facades
> Facades provide a "static" interface to classes that are available in the application's service container. Laravel ships with many facades which provide access to almost all of Laravel's features. Laravel facades serve as "static proxies" to underlying classes in the service container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods.
- the_duke 7y agoWhat isn't fake is that Laravel uses magic methods everywhere, especially in the ORM layer. There are way too many magic things happening under the hood for my taste.
- munk-a 7y agoMagic methods in PHP are very commonly used to help reduce code verbosity - having come from working mostly in C++ I appreciate being able to express things succinctly.
- malinens 7y agoMuch more important for code, especially library code is readability
- mjlangiii 7y agoLaravel is moving away from magic methods to using facades, FWIW.