Source code from laracast. https://laracasts.com/series/incremental-api-development