Get SMUG

A deeper dive into LaraElite's Smug Facade


If you've used LaraElite for even a short amount of time, you'll hear people whispering behind your back about how SMUG you are. In this tutorial, we go deeper into LaraElite's extravagent offering - the SMUG::facade - so that you can treat your co-workers with an even greater disgust.




~ CORE PHILOSOPHY ~

A Single Responsibility


The SMUG facade is responsible for one thing only - to help other classes in the system manage, use, borrow and generally communicate data that is relevant to their current needs, and their potential future needs, in such a way as to be non-specific and open-minded as possible.

Simplicity

The SMUG facade is responsible for helping developers do better and bigger things. That's it. Expecting more? Sorry to disappoint you.

How Does It Work?

Behind the scenes, the SMUG facade forward-slash pipe sniffs the private parts of a Factory worker to see if the perimeters are policed (it does this at the weekend, when the Factory workers are relaxed). If the perimeter is policed, the SMUG facade throws out a loud Boolean, which distracts the Factories constructor method. With the Factory method distracted, the SMUG facade clones itself and wears an instance of moustache.js while entering the reception room of the Factory. While the cloned object is communicating to the Secretary, the original object sneaks in the door and collects the Data Buns from the Factory floor.

How Do I Use It?

Keep it simple, stupid.
The first thing is to new up a Jeffrey class, which acts as the Daddy Object (a Daddy object is like a God class, seen from the perspective of a newbie). After you've paid Jeffrey class, it will impart OO knowledge to you, allowing you to spray the 'Mists Of OO' around your office. At this point, it won't matter that you don't understand the business domain because your co-workers will be so busy coughing on the convuluted terminology, and mesmerized by your design patterns that nobody will even think of checking to see if the site works.

Example

The sample class below shows how the SMUG class mimicks the English language, so that even extremely dim-witted people can use it. Notice how LaraElite generously uses tabs and spaces, which is a 100% original invention.
<!-- This is my code. I hope you're suprised and delighted by what it does.
$list = SMUG::pluck('usernames')->from->DB()
      ->and()->capitalize()->them();
echo SMUG->withoutMistakesAndSecurityProblems()->list;