mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-15 07:36:47 +00:00
voting system with nostr added
This commit is contained in:
24
app/Http/Controllers/Api/Nostr/GetProfile.php
Normal file
24
app/Http/Controllers/Api/Nostr/GetProfile.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\Nostr;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Profile;
|
||||
use App\Traits\NostrFetcherTrait;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class GetProfile extends Controller
|
||||
{
|
||||
use NostrFetcherTrait;
|
||||
|
||||
public function __invoke($key, Request $request)
|
||||
{
|
||||
if (!Profile::query()->where('pubkey', $key)->exists()) {
|
||||
$this->fetchProfile([$key]);
|
||||
}
|
||||
|
||||
return Profile::query()
|
||||
->where('pubkey', $key)
|
||||
->first();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user