2
Good night I wonder if in Laravel 5.1 there is a way to autoload, both in Models and Controllers? In Laravel 4 to create an instance of a Model, simply call the Model, thus:
$user = new User();
But from what I noticed on Laravel 5, you need to put the model’s path into the controller.
Ever tried to spin
composer dump-autoload
?– Bruno Wego
In Laravel 5 you need to call by the p.x namespace: App Models User;! Unless you create an alias in app.php. It is also possible to make the class map by Composer, psr-4
– juniorb2ss