Add new models and page for motions

This commit is contained in:
2025-12-27 16:51:57 +01:00
parent 3ef975ad39
commit 45fe15eef2
36 changed files with 3753 additions and 355 deletions

View File

@@ -2,30 +2,35 @@
namespace App\Livewire\Person;
use Livewire\Component;
use App\Services\RiksdagenService;
use App\Enums\Parties;
use App\Services\RiksdagenService;
use Livewire\Component;
class Search extends Component
{
public $firstName = '';
public $lastName = '';
public $party = '';
public $results = [];
public $parties = [];
public function mount()
{
$this->parties = collect(Parties::cases())->sortBy(fn($party) => $party->label())->toArray();
$this->parties = collect(Parties::cases())->sortBy(fn ($party) => $party->label())->toArray();
}
public function search()
{
$service = app(RiksdagenService::class);
$this->results = $service->searchPerson(
firstName: $this->firstName,
lastName: $this->lastName,
party: $this->party
party: $this->party,
)->original;
}