DEV Community

Tr.Ra
Tr.Ra

Posted on

use laravel repository class without __contruct

If you want Laravel to solve your dependencies, you must build your object with App::make instead of instanciate manually with new.

$myInstance = App::make('App\Repositories\CartRepository');

just in case you want to test in artisan tinker

Top comments (0)

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit