Categories
Design Patterns Laravel

Singleton Design Pattern with Laravel Example

The Singleton Design Pattern is generally used to ensure a class only has one instance of it. This pattern can be used in any language, but this article will demonstrate how to use the pattern in Laravel.

Categories
Design Patterns

Design Patterns Review with PHP Example

Design patterns are solutions to recurring problems in software development. These design patterns can be generic and sufficient for use in a wide range of applications, or they might be more specialized. Find out how to make the best use of these design patterns, and how they can help you save time and reduce your workload.

Categories
Design Patterns Laravel

Repository Design Pattern with Laravel Example

The repository design pattern is a way to separate the logic for retrieving data from a database from the rest of the application. It is a layer of abstraction between the data access layer and the business logic layer.

Categories
Design Patterns Laravel

Bridge Design Pattern with Laravel Example

The Bridge design pattern is a structural design pattern that can be used to separate the abstraction from the implementation in a software system. The pattern is useful when the abstraction and implementation need to be evolved independently.

Categories
Design Patterns Laravel

Adapter Design Pattern with Laravel Example

The adapter design pattern is a software design pattern that allows the interface of an existing class to be used as another interface. It is often used to make existing classes work with others without modifying their source code.

Categories
Design Patterns Laravel

Strategy Design Pattern with Laravel Example

The strategy design pattern is a behavioral design pattern that allows you to define a family of algorithms, encapsulate each one as an object, and make them interchangeable. This pattern is used to define a set of interchangeable algorithms from which the client can choose.

Categories
Debugging Docker

“Repository is not signed” when building Docker image

So you’re working on your project, and all of a sudden, Docker stops building your container images! You try to debug it verbosely, but there is no useful clue there.

Categories
Debugging Laravel

Resolve `No query results for model …` in Laravel Queue

So you’re using Laravel Queue for running your own jobs, but things get messy when you push changes to the production. Some of the jobs are working properly but sometimes (or often) they fail with message like this:

Illuminate\Database\Eloquent\ModelNotFoundException: No query results for model [...]. in /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:472
Categories
Laravel Testing

How to extend Laravel Dusk browser?

It’s a sunny afternoon, and you’re enjoying your test suit development progress. However, a week later, when you go back to your tests to make some changes, you find things pretty much confusing! Those assertion codes have just turned into a plate of spaghetti 🍝!