livewire 에서 array fill 채워넣는 방법

Updated on

https://livewire.laravel.com/docs/properties#bulk-assignment

간단하게 설명하자면 livewire 에서 array data 가 있을때, 특정 값에 데이터를 채워넣어야 할때가 있다. form edit 일때,

$this->fill(collect($responseData['data'] ?? [])->mapWithKeys(static fn($item, $key) => ["formData.{$key}" => $item]));

그럴때 이런식으로 해서 fill 메소드를 사용해서 채워넣을 수 있다.