mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-27 21:30:16 +00:00
first copies from portal
This commit is contained in:
46
app/Console/Commands/Nostr/RenderAllEvents.php
Normal file
46
app/Console/Commands/Nostr/RenderAllEvents.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands\Nostr;
|
||||
|
||||
use App\Traits\NostrEventRendererTrait;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
|
||||
class RenderAllEvents extends Command
|
||||
{
|
||||
use NostrEventRendererTrait;
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'render';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Command description';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$events = \App\Models\Event::query()
|
||||
->get();
|
||||
|
||||
foreach ($events as $event) {
|
||||
$this->renderContentToHtml($event);
|
||||
}
|
||||
|
||||
Broadcast::on('events')
|
||||
->as('newEvents')
|
||||
->with([
|
||||
'test' => 'test',
|
||||
])
|
||||
->sendNow();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user