Files
einundzwanzig-verein/app/Console/Commands/Nostr/SyncProfiles.php

40 lines
801 B
PHP

<?php
namespace App\Console\Commands\Nostr;
use App\Models\EinundzwanzigPleb;
use App\Traits\NostrFetcherTrait;
use Illuminate\Console\Command;
class SyncProfiles extends Command
{
use NostrFetcherTrait;
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'sync:profiles';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Execute the console command.
*/
public function handle()
{
$plebs = EinundzwanzigPleb::query()
->whereDoesntHave('profile')
->get();
if ($plebs->count() > 0) {
$this->fetchProfile($plebs->pluck('npub')->toArray());
}
}
}