Oussama Mater

Software

Laravel Under The Hood – The Magic of Macros | HackerNoon

Hello 👋 How often have you wished for a method that doesn’t exist on collections or string helpers? You start chaining methods, only to hit a wall when one of them turns out to be missing. Honestly, it’s understandable; frameworks, you know, are a one-size-fits-all thing. I found myself in this situation multiple times. Every time, before diving into how to extend the framework, I check to see if what I want to extend is

Read More »
Software

Laravel Under The Hood – What Are Facades? | HackerNoon

You’ve just installed a fresh Laravel application, booted it up, and got the welcome page. Like everyone else, you try to see how it’s rendered, so you hop into the web.php file and encounter this code: <?php use IlluminateSupportFacadesRoute; Route::get(‘/’, function () { return view(‘welcome’); }); It’s obvious how we got the welcome view, but you’re curious about how Laravel’s router works, so you decide to dive into the code. The initial assumption is: There’s

Read More »

Laravel’s Strategy Pattern: The Manager Under the Hood | HackerNoon

Wikipedia: In computer programming, the strategy pattern (also known as the policy pattern) is a behavioral software design pattern that enables an algorithm’s behavior to be selected at runtime. For the first time, a Wikipedia definition in an IT context makes sense to me. Nonetheless, we’ll be discussing the strategy pattern in this article and how Laravel uses it under the hood. It’s commonly referred to as the Manager pattern in the Laravel community. I’ve

Read More »
Software

PHP Development: Creating Toggleable Laravel Routes with Attributes | HackerNoon

Attributes offer the ability to add structured, machine-readable metadata information on declarations in code: Classes, methods, functions, parameters, properties, and class constants can be the target of an attribute. I believe the definition is on point, and I’m confident most developers reading this article have encountered attributes at least once. If you haven’t, they are essentially metadata added to a class. At this point, you might be wondering how they differ from PHPDOCs then? Well,

Read More »