Armen Markossyan

Create a custom Leaf tag in Vapor

Vapor

Recently, I’ve been interested in some server-side Swift and I’ve discovered the Vapor.

Vapor is a cool web-application development framework written in Swift. It’s partially inspired by Laravel, so if you’re familiar with it, you’ll probably feel at home.

While the above is true, there’re still some differences. As opposed to Laravel and its Blade templating engine, Vapor uses Leaf.

It’s new and sometimes lacks documentation, so I’ve decided to write this article and explain how to extend it.

Read more →

Stop implementing shopping carts like this

There’re many good online stores with great usability, prices and good selection of products.

Owners of these stores spend money on ads, promote their stores here and there, invent creative campaigns and promos and do all the other important stuff to make their stores successful. But there’s an obvious problem that some of them actually don’t notice and this problem is related to a shopping cart.

Read more →

Laravel 4 and "Error while sending STMT_PREPARE packet"

Sometimes we have to maintain and support legacy projects written in older versions of Laravel and one of my projects still uses Laravel 4.

Unfortunately, there’s a bug in Laravel’s Database package which sometimes causes an error when working with long running jobs.

Read more →

Make Laravel models better with PHP traits

I suppose that most web-developers have met a problem of “fat” models at some point of their career. Even good developers following SOLID principles by keeping validation rules and other business logic out of models, sometimes face this problem.

Luckily, there’s a stupidly easy solution which I’ve never seen in any Laravel project before. That’s why I decided to write this short article.

Read more →

Laravel and Repository pattern

In this article I’ll try explain how to use the repository pattern in Laravel framework and why it’s useful.

Let’s start with a simple example. Here’s what a typical Laravel controller looks like:

Read more →