Skip to content

Commit

Permalink
add database as a dependency to repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
esbenp committed Apr 15, 2016
1 parent c32b483 commit 6def367
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -11,6 +12,8 @@ abstract class Repository
{
use EloquentBuilderTrait;

protected $database;

protected $model;

protected $sortProperty = null;
Expand All @@ -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();
}

Expand Down

0 comments on commit 6def367

Please sign in to comment.