Testing a live site with Laravel Dusk using Docker Compose

Today we will do a quick tutorial on how to quickly install and run Laravel Dusk on your project using Docker.

We will use Docker only for running the selenium driver. It isn't therefore needed to use rocker to run the site we're testing again.

How to cache S3 stored pictures to local disk and serving them from your web server

How to cache S3 stored pictures to local disk and serving them from your web server

The problem

Recently I worked on upgrading a legacy Laravel v4.2 to a newer version of Laravel. The site stored user uploaded pictures, which where stored locally on the app's public folder.

Now, I didn't like the fact that those pictures where stored locally because if the server went down the picture files would go down as well. Therefore deploying to a new server would require the hassle of manually restoring the pictures from a backup.

I was thinking to upload all images to S3 and serve them from there, but on the other hand I didn't want to get additionally charged from AWS S3 for the pictures bandwidth. 

How could I get a local cache of those pictures? Here is the solution that worked for my case.

Free Email with your own Domain

As a freelance developer, I found it's more professional to have your email under your domain name. It's not just promoting your brand name, it is also advertising your website for free!

However it is not that easy to find a cheap email solution that just works. I've used several services in the past and suffered for the reasons mentioned below.

Today I will describe how to get a free email account with your own domain and how to setup the whole thing. As a requirement, you need to own a domain name (of course!) and have access to the dns settings.

We will use a combination of Zoho Mail and Gmail.

PhpStorm & phpspec

Phpspec has been my favorite unit testing tool after watching this laracasts tutorial. Phpspec is a toolset that helps writing fast and easy tests, and guides towards a better software design. PhpStorm on the other hand is a very powerful PHP editor and my IDE of choice.

Unfortunately phpspec is not supported by PhpStorm yet, although they promised to support it when they find the resources. There are some plugins out there but they are buggy, so it is not safe to use them. 

A nice tip to add autocompletion in your specs is to use @mixin annotation:

use PhpSpec\ObjectBehavior;

 * @mixin User
class UserSpec extends ObjectBehavior {


Finally, here are some useful resources about phpunit and phpstorm:

Cool JavaScript stuff I learned at the Open TechSchool workshop

If you are not aware of Open TechSchool, it is a community initiative offering free programming workshops to technology enthousiasts and is located in cities all around the globe.

Today and yesterday I participated at the workshop "Javascript for Absolute Beginners" of Open Techschool in Dortmund, and I would like to share with you what I learned.

Git repository inside composer vendors

After creating my first laravel package last week, I discovered a tip I wanted to share with you.

If you have write access to a composer package repository, you have the possibility to continue its development while it is installed as requirement in another project. Let's see how we can accomplish this.

Apache redirecting www to no-www

Every time I have to configure apache to host a new website, there is always a small SEO voice in my head asking me:

Did you create a www alias pointing to the website?

So let's go satisfy this little voice together.

Let's say our brand new url is http://example.com. We want to configure apache to redirect from http://www.example.com  to our new url. 

There are many solutions for that out there, but today I would like to share with you my favorite one.

Hello world!

echo 'Hello world!';

I am very happy to announce the release of my personal website. I will post here articles about stuff I learn and my life experiences. Most of the texts will be related to my hobby and passion: web development.