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 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 🍝!