mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
58 lines
1010 B
PHP
58 lines
1010 B
PHP
<?php
|
|
|
|
namespace App\Observers;
|
|
|
|
use App\Models\Course;
|
|
use App\Traits\NostrTrait;
|
|
use Exception;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
class CourseObserver
|
|
{
|
|
use NostrTrait;
|
|
|
|
/**
|
|
* Handle the Course "created" event.
|
|
*/
|
|
public function created(Course $course): void
|
|
{
|
|
try {
|
|
$this->publishOnNostr($course, $this->getText($course));
|
|
} catch (Exception $e) {
|
|
Log::error($e->getMessage());
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Handle the Course "updated" event.
|
|
*/
|
|
public function updated(Course $course): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Handle the Course "deleted" event.
|
|
*/
|
|
public function deleted(Course $course): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Handle the Course "restored" event.
|
|
*/
|
|
public function restored(Course $course): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Handle the Course "force deleted" event.
|
|
*/
|
|
public function forceDeleted(Course $course): void
|
|
{
|
|
//
|
|
}
|
|
}
|