alighorbani1381 / rayawebapplication

1 stars 0 forks source link

Fix repositories anti-pattern #3

Closed apm-dev closed 3 years ago

apm-dev commented 4 years ago

You should not use concrete classes, instead create e.g. UserRepository(interface) and UserRepositoryImpl and then in bind them together in AppServiceProvider, and inject them into your controller in constructor using service container, e.g. : public function __construct(UserRepository $userRepository) { $this->userRepository = $userRepository; }