SlimPHP package which adds a bunch of Laravel-esque Facades, Traits and helpers

TLDR: Here’s the package: Affinity4/SlimFacades

Why did I do this?

So, I use Laravel professionally, but when I’m just trying out a new package, or messing around with a concept I generally reach for Slim first.

Anyways, I was trying to learn more about how Laravel wires up its Facades so easily, and I decided to try do the same in Slim. A few days later and I added Macroable, Conditionable, ForwardsCalls, Tappable, tap(), response(), dd(), Pipeline, and Hub (you find this in the Laravel docs) and Dumpable (which will be in Laravel 11)

I learned a bunch about Laravel.

  1. The tap helper is awesome, and I have not used it enough!
  2. Pipelines are a great way to clean up your controllers and make them easier to unit test
  3. The Proxy Pattern is a great thing to have in your back pocket…check out the ForwardsCalls in the README. If you’ve ever wished you could inherit a final class in PHP, this pattern could be for you!

Hope you try it…hope you like it!

submitted by /u/LukeWatts85
[link] [comments]      



Author: AliensFaith
HighTech FinTech researcher, university lecturer & Scholar. He is studying his second doctoral degree at the Hague International University. Studying different fields of Sciences gave him a broad understanding of various aspects of life. His recent researches covered AI, Machine-learning & Automation concepts. The Information Technology Skills & Knowledge gave his company a higher position over other regional high-tech consultancy services. The other qualities and activities which can describe him are a Hobbyist Programmer, Achiever, Strategic Thinker, Futuristic person, and Frequent Traveler.

Discover more from Maheri Network

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version