mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2026-02-04 15:53:17 +00:00
🚀 feat(news): add news management with upload functionality and category selection in the association module
This commit is contained in:
46
app/Enums/NewsCategory.php
Normal file
46
app/Enums/NewsCategory.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
use ArchTech\Enums\From;
|
||||
use ArchTech\Enums\InvokableCases;
|
||||
use ArchTech\Enums\Meta\Meta;
|
||||
use ArchTech\Enums\Metadata;
|
||||
use ArchTech\Enums\Names;
|
||||
use ArchTech\Enums\Options;
|
||||
use ArchTech\Enums\Values;
|
||||
|
||||
#[Meta(Label::class, Color::class, Icon::class)]
|
||||
enum NewsCategory: int
|
||||
{
|
||||
use InvokableCases;
|
||||
use Names;
|
||||
use Values;
|
||||
use Options;
|
||||
use Metadata;
|
||||
use From;
|
||||
|
||||
#[Label('Organisation')] #[Color('cyan')] #[Icon('file-lines')]
|
||||
case ORGANISATION = 1;
|
||||
|
||||
public static function selectOptions()
|
||||
{
|
||||
return collect(self::options())
|
||||
->map(
|
||||
fn(
|
||||
$option,
|
||||
$name
|
||||
) => [
|
||||
'value' => $option,
|
||||
'label' => __(
|
||||
self::fromName($name)
|
||||
->label()
|
||||
),
|
||||
'icon' => self::fromName($name)
|
||||
->icon(),
|
||||
]
|
||||
)
|
||||
->values()
|
||||
->toArray();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user