Articles

Better HTTP Status Codes In Laravel

'Magic numbers' like 200 or 401 can cause a lot of confusion for colleagues or your future self. It's not always immediately obvious what these numbers represent.

A magic number is a number in the code that has no context or meaning.



Luckily, when it comes to HTTP Status Codes, we can make use of a complete set of constants that will make the meaning of your code self evident.

'Magic numbers' like 200 or 401 can cause a lot of confusion for colleagues or your future self. It's not always immediately obvious what these numbers represent.

A magic number is a number in the code that has no context or meaning.



Luckily, when it comes to HTTP Status Codes, we can make use of a complete set of constants that will make the meaning of your code self evident.

'Magic numbers' like 200 or 401 can cause a lot of confusion for colleagues or your future self. It's not always immediately obvious what these numbers represent.

A magic number is a number in the code that has no context or meaning.



Luckily, when it comes to HTTP Status Codes, we can make use of a complete set of constants that will make the meaning of your code self evident.

Thank you for reading this article.

If you've made it this far, you might like to connect with me on 𝕏 where I post similar content and interact with like-minded people. If this article was helpful to you I'd really appreciate it if you would consider buying me a coffee.
Continue Reading

Goodbye Forge, Hello Ploi

When it first launched, Laravel Forge was the easiest and cheapest way to deploy a Laravel application onto a custom server. Recently, after repeatedly being presented with upgrade banners for new features, I decided to investigate the alternatives before committing to a higher fee. Happily, I stumbled upon Ploi.

At first I was skeptical that anyone could compete with the Laravel Core team who manage the established and stable product that is Laravel Forge, but over a few short hours I was increasingly convinced that Ploi was not only a suitable alternative, but hands down the better offering. Here's what finally changed my mind, made me switch all my sites and end my Forge subscription.

When it first launched, Laravel Forge was priced at $10 a month for unlimited servers, sites and services. This was an amazing and probably somewhat underpriced offering. It was incredible to be able to launch a Laravel site with a few clicks and forget about server management entirely. No more digging around in Nginx config files and hours spent installing the latest version of this or that version of PHP. Over time, more features were added for team functionality. I didn't upgrade because I didn't need access to these features. Later, the basic subscription price was increased slightly for new users, but the fee for users on existing plans remained the same.

When it first launched, Laravel Forge was the easiest and cheapest way to deploy a Laravel application onto a custom server. Recently, after repeatedly being presented with upgrade banners for new features, I decided to investigate the alternatives before committing to a higher fee. Happily, I stumbled upon Ploi.

At first I was skeptical that anyone could compete with the Laravel Core team who manage the established and stable product that is Laravel Forge, but over a few short hours I was increasingly convinced that Ploi was not only a suitable alternative, but hands down the better offering. Here's what finally changed my mind, made me switch all my sites and end my Forge subscription.

When it first launched, Laravel Forge was priced at $10 a month for unlimited servers, sites and services. This was an amazing and probably somewhat underpriced offering. It was incredible to be able to launch a Laravel site with a few clicks and forget about server management entirely. No more digging around in Nginx config files and hours spent installing the latest version of this or that version of PHP. Over time, more features were added for team functionality. I didn't upgrade because I didn't need access to these features. Later, the basic subscription price was increased slightly for new users, but the fee for users on existing plans remained the same.

When it first launched, Laravel Forge was the easiest and cheapest way to deploy a Laravel application onto a custom server. Recently, after repeatedly being presented with upgrade banners for new features, I decided to investigate the alternatives before committing to a higher fee. Happily, I stumbled upon Ploi.

At first I was skeptical that anyone could compete with the Laravel Core team who manage the established and stable product that is Laravel Forge, but over a few short hours I was increasingly convinced that Ploi was not only a suitable alternative, but hands down the better offering. Here's what finally changed my mind, made me switch all my sites and end my Forge subscription.

When it first launched, Laravel Forge was priced at $10 a month for unlimited servers, sites and services. This was an amazing and probably somewhat underpriced offering. It was incredible to be able to launch a Laravel site with a few clicks and forget about server management entirely. No more digging around in Nginx config files and hours spent installing the latest version of this or that version of PHP. Over time, more features were added for team functionality. I didn't upgrade because I didn't need access to these features. Later, the basic subscription price was increased slightly for new users, but the fee for users on existing plans remained the same.

Thank you for reading this article.

If you've made it this far, you might like to connect with me on 𝕏 where I post similar content and interact with like-minded people. If this article was helpful to you I'd really appreciate it if you would consider buying me a coffee.
Continue Reading

Meta Tags, Link Tags And Web Manifests

Every time I make a new site, I spend a significant amount of time adding meta and link tags to the layout. I do this to improve SEO but also to control the way the site is rendered in different browsers, share sheets and operating systems. I often find myself looking up details which I have researched in the past. This article will list all the tags I use on this and other sites. I hope it will save you (and future me) a lot of time.

#The Basics

  • Meta tags represent metadata that cannot be represented by other HTML meta-related elements such as <title>, <script>, or <link>.
  • Link tags define relationships between the current document and external resources.


  • Every time I make a new site, I spend a significant amount of time adding meta and link tags to the layout. I do this to improve SEO but also to control the way the site is rendered in different browsers, share sheets and operating systems. I often find myself looking up details which I have researched in the past. This article will list all the tags I use on this and other sites. I hope it will save you (and future me) a lot of time.

    #The Basics

  • Meta tags represent metadata that cannot be represented by other HTML meta-related elements such as <title>, <script>, or <link>.
  • Link tags define relationships between the current document and external resources.


  • Every time I make a new site, I spend a significant amount of time adding meta and link tags to the layout. I do this to improve SEO but also to control the way the site is rendered in different browsers, share sheets and operating systems. I often find myself looking up details which I have researched in the past. This article will list all the tags I use on this and other sites. I hope it will save you (and future me) a lot of time.

    #The Basics

  • Meta tags represent metadata that cannot be represented by other HTML meta-related elements such as <title>, <script>, or <link>.
  • Link tags define relationships between the current document and external resources.
  • Thank you for reading this article.

    If you've made it this far, you might like to connect with me on 𝕏 where I post similar content and interact with like-minded people. If this article was helpful to you I'd really appreciate it if you would consider buying me a coffee.
    Continue Reading

    How To Build The Imagick Php Extension From Source

    Update: This instructions in this article should no longer be necessary as you can once again install imagick via pecl:

    pecl install imagick

    If you are still having issues, I would recommend this excellent article by Andrea Olivato.

    Update: This instructions in this article should no longer be necessary as you can once again install imagick via pecl:

    pecl install imagick

    If you are still having issues, I would recommend this excellent article by Andrea Olivato.

    Update: This instructions in this article should no longer be necessary as you can once again install imagick via pecl:

    pecl install imagick

    If you are still having issues, I would recommend this excellent article by Andrea Olivato.

    Thank you for reading this article.

    If you've made it this far, you might like to connect with me on 𝕏 where I post similar content and interact with like-minded people. If this article was helpful to you I'd really appreciate it if you would consider buying me a coffee.
    Continue Reading

    Privacy-Focused Alternatives To Google Analytics

    I recently wrote an article on how to add google analytics to a Nuxt JS app. In that post, I described the process I followed to install Google Analytics on this blog. I chose Google Analytics out of habit, without stopping to think whether it was the right solution for me.

    I knew that I would have to add a cookie banner to get visitors' permission to use cookies on their device. This led me implement a solution that ensures Google's tracking script is not loaded until the user gives their explicit consent.

    Later, I tweeted about how I felt sad to add yet another cookie banner to the internet. These banners have been around for a while, but recently it feels like the web is drowning in a sea of cookie widgets of ever-increasing complexity.

    I recently wrote an article on how to add google analytics to a Nuxt JS app. In that post, I described the process I followed to install Google Analytics on this blog. I chose Google Analytics out of habit, without stopping to think whether it was the right solution for me.

    I knew that I would have to add a cookie banner to get visitors' permission to use cookies on their device. This led me implement a solution that ensures Google's tracking script is not loaded until the user gives their explicit consent.

    Later, I tweeted about how I felt sad to add yet another cookie banner to the internet. These banners have been around for a while, but recently it feels like the web is drowning in a sea of cookie widgets of ever-increasing complexity.

    I recently wrote an article on how to add google analytics to a Nuxt JS app. In that post, I described the process I followed to install Google Analytics on this blog. I chose Google Analytics out of habit, without stopping to think whether it was the right solution for me.

    I knew that I would have to add a cookie banner to get visitors' permission to use cookies on their device. This led me implement a solution that ensures Google's tracking script is not loaded until the user gives their explicit consent.

    Later, I tweeted about how I felt sad to add yet another cookie banner to the internet. These banners have been around for a while, but recently it feels like the web is drowning in a sea of cookie widgets of ever-increasing complexity.

    Thank you for reading this article.

    If you've made it this far, you might like to connect with me on 𝕏 where I post similar content and interact with like-minded people. If this article was helpful to you I'd really appreciate it if you would consider buying me a coffee.
    Continue Reading