This commit is contained in:
philipp lang 2024-02-08 23:13:59 +01:00
parent c7b23df01e
commit 857051434e
4 changed files with 9 additions and 2 deletions

View File

@ -15,7 +15,7 @@ class FormApiListAction
use AsAction; use AsAction;
/** /**
* @param array<string, mixed> $filter * @param string $filter
* @return LengthAwarePaginator<Form> * @return LengthAwarePaginator<Form>
*/ */
public function handle(string $filter, int $perPage): LengthAwarePaginator public function handle(string $filter, int $perPage): LengthAwarePaginator

View File

@ -3,6 +3,7 @@
namespace App\Form\Actions; namespace App\Form\Actions;
use App\Form\Models\Form; use App\Form\Models\Form;
use App\Form\Models\Participant;
use App\Form\Resources\ParticipantResource; use App\Form\Resources\ParticipantResource;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection; use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Pagination\LengthAwarePaginator;
@ -12,6 +13,9 @@ class ParticipantIndexAction
{ {
use AsAction; use AsAction;
/**
* @return LengthAwarePaginator<Participant>
*/
public function handle(Form $form): LengthAwarePaginator public function handle(Form $form): LengthAwarePaginator
{ {
return $form->participants()->with('form')->paginate(15); return $form->participants()->with('form')->paginate(15);

View File

@ -12,6 +12,9 @@ class RegisterAction
{ {
use AsAction; use AsAction;
/**
* @param array<string, mixed> $input
*/
public function handle(Form $form, array $input): Participant public function handle(Form $form, array $input): Participant
{ {
return $form->participants()->create([ return $form->participants()->create([

View File

@ -45,7 +45,7 @@ class Form extends Model implements HasMedia
} }
/** /**
* @return HasMany<Participant, self> * @return HasMany<Participant>
*/ */
public function participants(): HasMany public function participants(): HasMany
{ {