fixes laravel/framework#5479

A fix for #5479