mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-14 06:36:46 +00:00
- Added a new console command `nostr:profile` which fetches a Nostr profile given a public key. - Updated the election admin view to fetch the profile if it doesn't exist in the database. - Introduced a new state variable `isAllowed` to handle authorization in the election admin view. - Redirect users with no admin access to the association profile page.
40 lines
757 B
PHP
40 lines
757 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands\Nostr;
|
|
|
|
use App\Traits\NostrFetcherTrait;
|
|
use Illuminate\Console\Command;
|
|
|
|
class FetchProfile extends Command
|
|
{
|
|
use NostrFetcherTrait;
|
|
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'nostr:pofile {--pubkey=}';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Command description';
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*/
|
|
public function handle()
|
|
{
|
|
$pubkey = $this->option('pubkey');
|
|
if (empty($pubkey)) {
|
|
$this->error('Please provide a pubkey');
|
|
return;
|
|
}
|
|
|
|
$this->fetchProfile([$pubkey]);
|
|
}
|
|
}
|