Armen Markossyan

Create a custom Leaf tag in Vapor

Vapor

I’ve been recently interested in server-side Swift and stumbled upon the Vapor framework.

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

While the above information 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 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 programmers have to maintain and support legacy projects written in older versions of frameworks.

So do I. One of my projects still uses Laravel 4 and, unfortunately, there’s a bug in its 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 to 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 →