Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

add cachedriver default value in config #175

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,24 @@
'delete',
],



/*
|--------------------------------------------------------------------------
| Cache driver
|--------------------------------------------------------------------------
|
| Here you may specify the cache driver that you wish the cache
| to user.
|
| Default: array
|
*/



'driver' => env('CACHE_DRIVER', 'array'),

/*
|--------------------------------------------------------------------------
| Cache Skipping URI
Expand Down
3 changes: 2 additions & 1 deletion src/Traits/Cacheable.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ public function setCacheDriver($cacheDriver)
*/
public function getCacheDriver(): string
{
return $this->cacheDriver;
// Return value even if cacheDriver did not set in construcor
return $this->cacheDriver ?? $this->getContainer('config')->get('rinvex.repository.cache.driver');
}

/**
Expand Down