mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-13 06:56:48 +00:00
new observers
This commit is contained in:
80
app/Observers/BitcoinEventObserver.php
Normal file
80
app/Observers/BitcoinEventObserver.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace App\Observers;
|
||||
|
||||
use App\Models\BitcoinEvent;
|
||||
|
||||
class BitcoinEventObserver
|
||||
{
|
||||
/**
|
||||
* Handle the BitcoinEvent "created" event.
|
||||
*
|
||||
* @param \App\Models\BitcoinEvent $bitcoinEvent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function created(BitcoinEvent $bitcoinEvent)
|
||||
{
|
||||
if (config('feeds.services.twitterAccountId')) {
|
||||
$this->setNewAccessToken(1);
|
||||
|
||||
$text = sprintf("Ein neues Event wurde eingestellt:\n\n%s\n\n%s bis %s\n\n%s\n\n%s\n\n#Bitcoin #Event #Einundzwanzig #gesundesgeld",
|
||||
$bitcoinEvent->title,
|
||||
$bitcoinEvent->from->asDateTime(),
|
||||
$bitcoinEvent->to->asDateTime(),
|
||||
$bitcoinEvent->venue->name,
|
||||
$bitcoinEvent->link,
|
||||
);
|
||||
|
||||
$this->postTweet($text);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the BitcoinEvent "updated" event.
|
||||
*
|
||||
* @param \App\Models\BitcoinEvent $bitcoinEvent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function updated(BitcoinEvent $bitcoinEvent)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the BitcoinEvent "deleted" event.
|
||||
*
|
||||
* @param \App\Models\BitcoinEvent $bitcoinEvent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function deleted(BitcoinEvent $bitcoinEvent)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the BitcoinEvent "restored" event.
|
||||
*
|
||||
* @param \App\Models\BitcoinEvent $bitcoinEvent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function restored(BitcoinEvent $bitcoinEvent)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the BitcoinEvent "force deleted" event.
|
||||
*
|
||||
* @param \App\Models\BitcoinEvent $bitcoinEvent
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function forceDeleted(BitcoinEvent $bitcoinEvent)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user