Initial Commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Observers;
|
||||
|
||||
use App\Models\Post;
|
||||
use App\Services\PostMediaCacher;
|
||||
|
||||
class PostObserver
|
||||
{
|
||||
public function __construct(private readonly PostMediaCacher $mediaCacher)
|
||||
{
|
||||
}
|
||||
|
||||
public function created(Post $post): void
|
||||
{
|
||||
$this->mediaCacher->cache($post);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user