Skip to content

Commit

Permalink
Merge branch 'main' into feature/store-with-parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
markvaneijk authored Apr 21, 2024
2 parents 64944b5 + d571f31 commit 4578e6f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CachesValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Cache;
use ReflectionClass;
use Vormkracht10\PermanentCache\Events\CacheUpdatedEvent;
use Vormkracht10\PermanentCache\Events\CacheUpdatingEvent;

/**
* @template V
Expand Down Expand Up @@ -68,6 +70,8 @@ final public function handle($event = null): void
return;
}

CacheUpdatedEvent::dispatch($this);

Cache::driver($driver)->forever($ident, $value);

$this->updating = false;
Expand Down
17 changes: 17 additions & 0 deletions src/Events/CacheUpdatedEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Vormkracht10\PermanentCache\Events;

use Illuminate\Foundation\Events\Dispatchable;
use Vormkracht10\PermanentCache\Cached;
use Vormkracht10\PermanentCache\CachedComponent;

class CacheUpdatedEvent
{
use Dispatchable;

public function __construct(public readonly Cached|CachedComponent $cache)
{
//
}
}
17 changes: 17 additions & 0 deletions src/Events/CacheUpdatingEvent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Vormkracht10\PermanentCache\Events;

use Illuminate\Foundation\Events\Dispatchable;
use Vormkracht10\PermanentCache\Cached;
use Vormkracht10\PermanentCache\CachedComponent;

class CacheUpdatingEvent
{
use Dispatchable;

public function __construct(public readonly Cached|CachedComponent $cache)
{
//
}
}

0 comments on commit 4578e6f

Please sign in to comment.