refactor for laravel 5.0