Skip to content
This repository has been archived by the owner on Oct 12, 2019. It is now read-only.

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
knash94 committed Jan 16, 2017
1 parent 36d5cf4 commit c5c8225
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/BaseCacheRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class BaseCacheRepository implements BaseRepositoryContract
{

/**
* @var baseRepositoryEloquent
* @var baseEloquentRepository
*/
private $repository;
/**
Expand All @@ -20,7 +20,6 @@ class BaseCacheRepository implements BaseRepositoryContract

public function __construct(BaseEloquentRepository $repository, Cache $cache)
{

$this->repository = $repository;
$this->cache = $cache;
$this->repository->makeModel($this->model);
Expand Down Expand Up @@ -108,7 +107,6 @@ public function create(array $attributes)
*/
public function get()
{
//var_dump('cache key: ' . $this->getCacheKey());
return $this->cache->tags($this->getModelName())->remember($this->getCacheKey(), 5, function(){
return $this->repository->get();
});
Expand Down
4 changes: 3 additions & 1 deletion src/BaseEloquentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class BaseEloquentRepository implements BaseRepositoryContract
protected $query;

public function __construct(){
$this->makeModel($this->model);
if ($this->model){
$this->makeModel($this->model);
}
}
/**
* Get all models
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Commands/Template/CacheRepositoryTemplate.stub
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class DummyClass extends BaseCacheRepository
* Replace $model with your models class
*
* example:
* protected $model = App\User::class;
* protected $model = \App\User::class;
*
* @var null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class DummyClass extends BaseEloquentRepository
* Replace $model with your models class
*
* example:
* protected $model = App\User::class;
* protected $model = \App\User::class;
*
* @var null
*/
Expand Down

0 comments on commit c5c8225

Please sign in to comment.