nostr events schedule

This commit is contained in:
HolgerHatGarKeineNode
2023-02-24 11:40:02 +01:00
parent 235ce774f9
commit c99ebca063
2 changed files with 31 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ class PublishUnpublishedItems extends Command
*/
public function handle(): void
{
config(['app.user-timezone' => 'Europe/Berlin']);
$modelName = $this->option('model');
$className = '\\App\Models\\'.$modelName;
$model = $className::query()
@@ -33,6 +34,7 @@ class PublishUnpublishedItems extends Command
->when($modelName === 'BitcoinEvent', fn($q) => $q->where('from', '>', now()))
->when($modelName === 'CourseEvent', fn($q) => $q->where('from', '>', now()))
->when($modelName === 'MeetupEvent', fn($q) => $q->where('start', '>', now()))
->when($modelName === 'LibraryItem', fn($q) => $q->where('type', '<>', 'markdown_article'))
->first();
$this->publishOnNostr($model, $this->getText($model));
}