Moved everything from plain PHP to the laravel framework.