The latest

Laravel validator: This field or that field is required, but not both

Recently, I needed to produce a check where one of two fields were required in a form submission, but not both. For example, say we had a house phone number field and a mobile phone number field but we only required one of those upon submission and not both, how can we do that?

I searched the web and found a few interesting articles however I opted to write my own validator, which you can see below.

Validator::extendImplicit('this_or_that', function ($attribute, $value, $parameters, $validator) {
    return (bool) (!empty($value) ^ (array_key_exists($parameters[0], $validator->getData()) && !empty($validator->getData()[$parameters[0]])));

To use this, place the above (more…)

Code guide

This code guide is primarily for my own benefit (but feel free to use it also) so that when writing code and organizing files I can focus on solving problems without having to think too much about minor details such as code formatting. This article was inspired by (more…)

Too much choice is bad

Skylake PC build

I put together a new PC recently (as shown above) and when I was choosing the parts I had a seemingly endless list of possible choices to make. Which graphics card? Are there any new graphics cards coming out soon? How is this graphics card different from this other one? Which one is the most appropriate for me considering cost and the performance I need? And that is just one component of about ten to go through. I honestly wish that hardware manufacturers (and all industries for that matter) would clearly describe who their products are for and how it differs from all of their other products. (more…)


If you'd like to contact me then simply leave a comment on this post below (don't worry it won't be published) and remember to leave your email if you want a reply.

imgBox: A tiny lightbox jQuery plugin

imgBox is a tiny lightbox script written as a jQuery plugin. The idea was to create a tiny yet responsive, accessible and stable lightbox script. It doesn't have all the bells and whistles and it's not supposed to, but here is what it does have: (more…)

4K Papers

4K Papers is another site that I created back in 2014. I spent about a month creating this thing using CodeIgniter and my own frontend code (I didn't use a CSS framework - all hand written baby).

The site hosts 4K (Ultra HD) resolution wallpapers and has badass filtering options (made by yours truly). I initially created it because I thought it would be a fun little project to do but also because 4K monitors were starting to become more mainstream and I wanted to help people who had just purchased a new shiny one to find a cool ultra HD picture (royalty free of course) to slap on their desktop.