There may be times when you are working with arrays in your PHP code and need to switch the order of two items. If you’re using an array that uses integers as keys, this can be a pretty straightforward task. However, if you’re trying to swap two items of an associative array, this can be little bit more hands-on. So, in this short post, I’ll show you how you can use macros in Laravel to keep your code looking clean and reusable.

By the end of the post, you should have a brief idea on how to create a macro…


Testing is an integral part to web and software development. It helps to give you the confidence that any code that you have written meets acceptance criteria and also reduces the chances of your code having bugs. In fact, TDD (test driven development), a popular development approach, actually focuses around tests being written before any code is added to the actual app code base.

Intended Audience

This article is aimed at developers who are fairly new to the Laravel world but have a basic understanding of tests. This article won’t cover how to write basic tests (that’s for another post in the…

How to Validate Email Addresses using Laravel Mailbox Layer


Data integrity and validation are important aspects of web development and data collection. It’s always important that we (as web developers) validate data before we store in the database. As an example, imagine that you’re building a form for a new website that visitors can use to subscribe to your new email newsletter. I’m sure that you’d want to make sure that anyone submitting the form was using a valid email address and not trying to add any spam addresses.

Sure, there are things that you could do to verify that email, such as sending out a confirmation email for…


No matter if you’re brand new to Laravel or have been using it for years, there’s always something new to learn. The framework and its ecosystem are constantly evolving and growing to improve the overall developer experience. So, it can be quite important to keep up to date with the latest changes so that you don’t fall behind.

It’s also likely that you’ve run into a coding problem once or twice and needed to reach out to people online for a bit of advice and help. Let’s be honest, as developers we spend quite a lot of time searching online…


It’s estimated that 40% of people will leave a website if it takes longer than 3 seconds to load! So, it’s incredibly important from a business standpoint to make sure that you stay under that 3 second threshold.

Therefore, whenever I write any code for my new Laravel projects, I try to make sure to optimise the code as much as I can within my given time and cost constraints. If I ever work on any existing projects, I also try to use these techniques to update any slow running code to improve the overall experience for the users.


Should I use WordPress for My Website? — Ash Allen Design


WordPress is a platform and CMS (content management system) that you can use to build and manage your website. It’s actually used to power a large number of websites around the world. In fact, you probably visit quite a few WordPress websites on a daily basis without realising. It flaunts that it’s the “world’s most popular website builder” and powers 38% of websites. Those are some seriously impressive numbers!

Ash Allen

I’m a Laravel web developer based in the UK. I specialise in building websites and systems for small businesses to help them grow and increase their sales.

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