mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-06-17 16:40:31 +00:00
✨ Add leader management functionality for Meetups
- ➕ Introduced `leaders`, `promoteLeader`, and `demoteLeader` methods in `Meetup` model for consistent handling of meetup leadership. - ⚙️ Refactored `MeetupLeaderController` to use new leadership methods, improving reusability and maintainability. - 👮♂️ Added `ValidNpub` validation rule for npub input standardization. - 🧪 Added feature tests for leadership delegation and permissions. - 🖼️ Implemented leader management UI in meetup edit page with flash messaging for actions.
This commit is contained in:
@@ -2,9 +2,8 @@
|
||||
|
||||
namespace App\Http\Requests\Api;
|
||||
|
||||
use Closure;
|
||||
use App\Rules\ValidNpub;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use swentel\nostr\Key\Key as NostrKey;
|
||||
|
||||
/**
|
||||
* Setzt einen weiteren Leader für ein Meetup per Nostr-npub ein. Nur ein
|
||||
@@ -24,18 +23,7 @@ class StoreMeetupLeaderRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'npub' => [
|
||||
'required',
|
||||
'string',
|
||||
'starts_with:npub1',
|
||||
function (string $attribute, mixed $value, Closure $fail): void {
|
||||
try {
|
||||
(new NostrKey)->convertToHex((string) $value);
|
||||
} catch (\Throwable) {
|
||||
$fail(__('Das ist kein gültiger npub.'));
|
||||
}
|
||||
},
|
||||
],
|
||||
'npub' => ['required', 'string', new ValidNpub],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user