Skip to content

Commit

Permalink
add cache function
Browse files Browse the repository at this point in the history
  • Loading branch information
BMTmohammedtaha committed Jan 3, 2024
1 parent 2f5d008 commit c4d6e9b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
use Effectra\Router\Route;
use Effectra\Session\Contracts\SessionInterface;
use Effectra\Session\Session;
use Psr\Cache\CacheItemPoolInterface;
use Psr\Http\Message\ResponseInterface;

use Psr\SimpleCache\CacheInterface;

if (!function_exists('env')) {
/**
Expand Down Expand Up @@ -179,7 +180,17 @@ function router()
return Application::container()->get(Route::class);
}
}

if (!function_exists('cache')) {
/**
* Get the cache instance.
*
* @return CacheInterface The cache instance.
*/
function cache():CacheInterface
{
return Application::container()->get(CacheInterface::class);
}
}
if (!function_exists('session')) {
/**
* Get the session instance.
Expand Down

0 comments on commit c4d6e9b

Please sign in to comment.