How to use a Presenter class Super simple! class BookPresenter extends Presenter { public function __construct( public Book $book ) {} public function price() { return number_format($this->book->price, 2); } }...
Another Design Pattern to cover in PHP are the Transformers . This one is really simple to understand. It allows you to return an object to another format in a re-usable way. For laravel developers, this is mostly done through Resources . Fo...
TL;DR A repository is an interface-signed class that encapsulate all SQL queries in specific methods. The repository class is then injected into your controller methods using dependency injection. You use the class methods instead of running sql q...
VS Code is a powerful and versatile IDE, but out of the box, it doesn't have much support for PHP developers. Fortunately, the PHP community made several extensions that makes VS Code a robust editor. Here's the most important extensions you need...
For the past weeks I've been working on a design overhaul of laravelpackages.net For those who don't know this website, it's a database of composer packages made for laravel. It's very useful when you are looking for a package and want to quickly...
TLDR; With Abstract Classes, you can define default behaviours that can be inherited by subclasses. That's not possible with interfaces. The template design pattent makes use of abstract classes. It defines default behaviour in the parent class but...
I just recently setup a new VPS to install discourse. First step was to create my subdomain on cloudflare. Then I ssh'd into the VPS and start executing the discourse install commands. I was stuck on the very begining because the script said i...
I consider myself as an IT Business Artisan. Or Consultant CTO. I'm a self-taught Web Developper, coach and teacher. My main work is helping and guiding digital startups.
more about meBTC
18SY81ejLGFuJ9KMWQu5zPrDGuR5rDiauM
ETH
0x519e0eaa9bc83018bb306880548b79fc0794cd08
XMR
895bSneY4eoZjsr2hN2CAALkUrMExHEV5Pbg8TJb6ejnMLN7js1gLAXQySqbSbfzjWHQpQhQpvFtojbkdZQZmM9qCFz7BXU
2024 © My Dynamic Production SRL All rights Reserved.