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