This commit is contained in:
23
app/Livewire/Party/Index.php
Normal file
23
app/Livewire/Party/Index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Livewire\Party;
|
||||
|
||||
use App\Enums\Parties as PartyEnum;
|
||||
use Livewire\Component;
|
||||
|
||||
class Index extends Component
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
$parties = collect(PartyEnum::cases())->map(function ($party) {
|
||||
return [
|
||||
'code' => $party->value,
|
||||
'name' => $party->label(),
|
||||
'logo' => $party->logo(),
|
||||
];
|
||||
});
|
||||
|
||||
return view('livewire.party.index', compact('parties'))
|
||||
->title('Partier - Riksdagen App');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user