Files
einundzwanzig-portal/app/Observers/BitcoinEventObserver.php
HolgerHatGarKeineNode 235ce774f9 nostr events added
2023-02-24 11:13:43 +01:00

58 lines
1.1 KiB
PHP

<?php
namespace App\Observers;
use App\Models\BitcoinEvent;
use App\Traits\NostrTrait;
use Exception;
use Illuminate\Support\Facades\Log;
class BitcoinEventObserver
{
use NostrTrait;
/**
* Handle the BitcoinEvent "created" event.
*/
public function created(BitcoinEvent $bitcoinEvent): void
{
try {
$this->publishOnNostr($bitcoinEvent, $this->getText('BitcoinEvent'));
} catch (Exception $e) {
Log::error($e->getMessage());
}
}
/**
* Handle the BitcoinEvent "updated" event.
*/
public function updated(BitcoinEvent $bitcoinEvent): void
{
//
}
/**
* Handle the BitcoinEvent "deleted" event.
*/
public function deleted(BitcoinEvent $bitcoinEvent): void
{
//
}
/**
* Handle the BitcoinEvent "restored" event.
*/
public function restored(BitcoinEvent $bitcoinEvent): void
{
//
}
/**
* Handle the BitcoinEvent "force deleted" event.
*/
public function forceDeleted(BitcoinEvent $bitcoinEvent): void
{
//
}
}