Make it compatible with laravel 4 and above