Tweaked to make it ready for Laravel