27 lines
682 B
PHP
27 lines
682 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class ResidenceResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return $this->resource ? [
|
|
'residence_id' => $this->residence_id,
|
|
'person_id' => $this->person_id,
|
|
'town_or_city' => $this->town_or_city,
|
|
'home_at_death' => $this->home_at_death,
|
|
'created_at' => $this->created_at,
|
|
'updated_at' => $this->updated_at,
|
|
] : null;
|
|
}
|
|
}
|