Updated for new versions of Laravel.