WHMCS Database tips and tricks – The basics

I’ve been involved with php and MySQL based programming for quite some time. Starting with mysql_xx (now deprecated), I moved to mysqli-> due to the familiarity of things. This was a great choice, but when it came time to get serious about WHMCS development, well, it was time to learn (again).  Hopefully this series will be a bit of help to someone else. My goal is to gain and pass as much knowledge on to you, as the WHMCS documentation (as usual) doesn’t really cover much here. It barely even covers the basic ‘howto’ of doing things.

To begin with, some references:
WHMCS utilizes the laravel codebase. So, their schema and query documentation will most likely come in quite helpful to you. I know they certainly were to me.
WHMCS has a small bit of documentation on MySQL as well.

Important:
When using Capsule, you need to make sure to initialize it at the top of the php file. This will do that:

use Illuminate\Database\C