Skip to content

Commit

Permalink
update the listener
Browse files Browse the repository at this point in the history
  • Loading branch information
Kylewalow committed Sep 22, 2023
1 parent fcf4e14 commit 15aa05b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 41 deletions.
41 changes: 0 additions & 41 deletions src/Listeners/UpdateImagesMissingAltCache.php

This file was deleted.

29 changes: 29 additions & 0 deletions src/Listeners/UpdateImagesMissingAltCacheListener.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Teamnovu\StatamicImagesMissingAlt\Listeners;

use Statamic\Events\AssetDeleted;
use Statamic\Events\AssetSaved;
use Statamic\Events\AssetUploaded;
use Teamnovu\StatamicImagesMissingAlt\Jobs\UpdateMissingAltCacheJob;

class UpdateImagesMissingAltCacheListener
{
public function handle($event)
{
UpdateMissingAltCacheJob::dispatch($event);
}

/**
* Register the listeners for the subscriber.
*
* @param \Illuminate\Events\Dispatcher $events
* @return void
*/
public function subscribe($events)
{
$events->listen(AssetDeleted::class, [self::class, 'handle']);
$events->listen(AssetSaved::class, [self::class, 'handle']);
$events->listen(AssetUploaded::class, [self::class, 'handle']);
}
}

0 comments on commit 15aa05b

Please sign in to comment.