Skip to content

Commit

Permalink
Merge pull request #34 from intraordinaire/master
Browse files Browse the repository at this point in the history
Update code due to Laravel 5.8 migration
  • Loading branch information
mfrancois authored Jul 10, 2019
2 parents dd97a59 + 020d735 commit 0dc40d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 2 additions & 8 deletions src/Distilleries/Expendable/ExpendableServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,12 @@
use Distilleries\Expendable\Layouts\LayoutManager;
use Distilleries\Expendable\Models\User;
use Distilleries\Expendable\States\StateDisplayer;
use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\ServiceProvider;
use Illuminate\Foundation\AliasLoader;

class ExpendableServiceProvider extends ServiceProvider
class ExpendableServiceProvider extends ServiceProvider implements DeferrableProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = true;

/**
* Bootstrap the application events.
*
Expand Down
4 changes: 2 additions & 2 deletions src/Distilleries/Expendable/Http/Middleware/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ class Cache
*/
public function handle($request, Closure $next)
{
if (config('cache.enabled') === true) {
if (config('cache.enabled') === true && null !== config('cache.minutes')) {
$url = $request->url();

$key = md5($url.json_encode($request->query()));
$value = \Cache::remember($key, config('cache.minutes'), function() use ($next, $request) {
$value = \Cache::remember($key, now()->addMinutes(config('cache.minutes')), function() use ($next, $request) {
return $next($request);
});

Expand Down

0 comments on commit 0dc40d5

Please sign in to comment.