From 6def36744aeff7e33f7f7f7c5c7ddb0ba9601bc3 Mon Sep 17 00:00:00 2001 From: Esben Petersen Date: Fri, 15 Apr 2016 15:06:03 +0200 Subject: [PATCH] add database as a dependency to repositories --- src/Repository.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Repository.php b/src/Repository.php index fa2709d..1c724e0 100644 --- a/src/Repository.php +++ b/src/Repository.php @@ -2,6 +2,7 @@ namespace Optimus\Database\Eloquent; +use Illuminate\Database\DatabaseManager; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; use Optimus\Database\Eloquent\Model; @@ -11,6 +12,8 @@ abstract class Repository { use EloquentBuilderTrait; + protected $database; + protected $model; protected $sortProperty = null; @@ -20,8 +23,9 @@ abstract class Repository abstract protected function getModel(); - final public function __construct() + final public function __construct(DatabaseManager $database) { + $this->database = $database; $this->model = $this->getModel(); }