Originally published at www.jamesfairhurst.co.uk.

Previously my old site hosted quite a number of really old blog posts, most recent was 2013 with the majority in 2008 when I was primarily developing in CakePHP. I wanted a clean slate (as do all devs!) so decided not to port them over or bother with creating an archive. By default on Forge when setting up SSL everything gets redirected to it’s https counterpart, for old blog posts the initial server response was a 301 redirect (http -> https) then a 404 as the page wasn’t found.

To keep things clean and indicate to…

If you’re using Laravel 5.5 or below my old medium article may be what you’re after. The following will only work in recent versions.

The Monolog logging library that Laravel uses is really quite powerful, like most things in the framework it works flawlessly out of the box and unless you want to do something specific you may not need to investigate how it works.

I previously wrote an article for old versions of Laravel detailing using multiple log files which kind of worked, but I wanted to revisit and see if things have changed in newer versions.

Say you…

Originally published at www.jamesfairhurst.co.uk.

I really like the svg image in the header of the blog, it was taken from SVG Backgrounds and I thought it would be quite cool to try to animate it by updating the colours to convey some sort of wave. It’s not animation as such as it isn’t using CSS to move things but I did want to cycle through the colours.

I first mapped out the colours used $colours = ['364347','465256','566164','667073','767F82','868E91','969D9F','A7ACAE','B7BBBD','C7CACB']; in an array so that I could cycle through them, moving the first colour to the back of the array in an attempt…

Originally published at www.jamesfairhurst.co.uk.

Wanting to use as little JavaScript as possible on my new site I didn’t want to go down the traditional route of adding Google’s global site tag (gtag.js) or Google Tag Manager — it feels a bit dirty these days and I personally use Ghostery to block everything anyway. Perhaps a bit hypocritical of me but I did still want to know what pages are being seen the most. I looked into a few privacy focused analytics services but in the end wanted todo something server side so that it didn’t impose on the front end.

Originally published at www.jamesfairhurst.co.uk.

Previously my old site hosted quite a number of subdomains for old projects and scripts, when moving to Laravel Forge and setting up SSL everything now gets redirected. I wanted to serve 404s for those old subdomains as it’s more of a correct response than a 301 to the homepage.

I’m not familiar with NGINX but the configs are nice and clean, Forge uses a before include which has a ssl_redirect.conf file which deals with redirecting non https traffic to it's https counterpart.

# FORGE CONFIG (DO NOT REMOVE!)include forge-conf/www.example.co.uk/before/*;server {

I created…

Originally published at www.jamesfairhurst.co.uk.

Medium is a great place for content, combined with the lovely easy interface for writing it seemed a great place to put all your publications. As they’ve grown and started to try to make money (as they should) things have become a little more restrictive. Paid subscriptions, pay walls, etc urgh. It’s not what it used to be and people are moving away. Having said that the reach & exposure of Medium can still be useful and so cross posting is possible and this is how.

Importing into Medium is possible, instead of writing a new…

Originally published at www.jamesfairhurst.co.uk.

Every New Year is a fresh slate, people make resolutions, review the previous year and set intentions on what they want to do this year. I’m no different! My site was very outdated and cringe worthy, last post was in 2013 and things have changed (2 kids happened and tiredness is at 11!) I did intend to get the new site out of the door in January but with client work and a 2 month old baby things didn’t go to plan!

Perfect is the enemy of good


Recently I read a great article about…

I wanted to get dusk running on CircleCI for a recent project and while there are a few recent articles unfortunately they didn’t work for me.

Using the official config file from the docs as a starting point I was getting the following error:

1) Tests\Browser\ExampleTest::testBasicExample
Facebook\WebDriver\Exception\UnknownServerException: unknown error: Chrome version must be >= 55.0.2883.0

So it looks like I need to update chrome, logged in via SSH and tried to do it manually using sudo apt-get update & sudo apt-get upgrade however it was telling me it was fully upto date but the version still wasn’t the latest. …

Recently I wanted to split out log files depending on the severity level however it was a bit trickier than I expected. The official docs mention configuring Monolog but don’t provide much detail. I’ve not used the package before and hunting around the docs and Google didn’t give me much to go on and confused me.

I initially just wanted to log info levels to a separate file, thinking it would be as simple as pushing a handler with just the INFO constant that unfortunately didn’t work. …

I recently got notified of Pipelines in Bitbucket which is a nice feature, I’ve used similar tools such as Travis CI & Codeship previously which are great but having CI built into your private Bitbucket repos is super handy. Turns out it’s relatively straight forward to get up & running. I wanted to quickly get a brand new 5.3 Laravel app connected so this is what I did.

Don’t want to dilly-dally around here? Go straight to the Bitbucket repo here. (15/05/17 — updated to 5.4)

Getting Setup

Head over to the Pipelines nav section and enable Pipelines, choose PHP and click…

James Fairhurst

You live till you die - QOTSA

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store