Skip to content

Instantly share code, notes, and snippets.

@neverything
Last active October 28, 2023 06:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neverything/92c5a951060a2f0234c4faa75a26741d to your computer and use it in GitHub Desktop.
Save neverything/92c5a951060a2f0234c4faa75a26741d to your computer and use it in GitHub Desktop.
<?php
namespace App\Listeners;
use App\Events\ProjectPublishedEvent;
use App\Models\Project;
use Illuminate\Support\Facades\Artisan;
class RunGenerateShareImageCommand
{
public function handle(ProjectPublishedEvent $event): void
{
if ($event->project instanceof Project) {
Artisan::call('open-graph-image:generate', [
'project' => $event->project->slug,
]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment