LARAVEL FACADES – WRITE TESTABLE CODE

Ha Nguyen

May 8, 2024

For one reason or another, Laravel Facades don’t get much love. I often read about how they are not a true facade implementation, and let me tell you, they’re not 🤷. They’re more like proxies than facades. If you think about it, they simply forward calls to their respective classes, effectively intercepting the request. When you start looking at them this way, you realize that facades, when used correctly, can result in a clean and testable code. So, don’t get too caught up in the naming, I mean who cares what they are called? And let’s see how we can make use of them.

 

Please read more on: https://blog.oussama-mater.tech/facades-write-testable-code/

WRITE A COMMENT
Save my information in this browser for the next time I comment
Comment anonymously
Vitex Vitex Vietnam Software., JSC

Service Request Form

Send us your service request and we will get back to you instantly

1 Contact Infomation
  • Name
  • Email
  • Phone
  • Company
  • Address
  • Skype/Telegram
2 Service Request
Website
Mobile Application
Website Application
Other
  • Start time
    icon time
  • End time
    icon time
  • What is your budget range?
    icon time
    Currency USD
  • Front-end
    Ex. React, VueS...
  • Back-end
    Ex. PHP, Java, Python...
  • Database
    Ex. MySQL, Mongo...
  • Advanced technologies
    Ex. Blockchain, AI...
yes
no
  • Select role
    icon time
  • Quantity
    icon time
  • Duration
    icon time
remove

Request Form Successfully !

We' ll contact you in the earliest time.