2020-06-02 23:45:25 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Member;
|
|
|
|
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
|
|
|
|
class MemberResource extends JsonResource
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Transform the resource into an array.
|
|
|
|
*
|
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function toArray($request)
|
|
|
|
{
|
2021-04-11 02:55:26 +02:00
|
|
|
return [
|
|
|
|
'firstname' => $this->firstname,
|
|
|
|
'lastname' => $this->lastname,
|
|
|
|
'address' => $this->address,
|
|
|
|
'zip' => $this->zip,
|
|
|
|
'location' => $this->location,
|
|
|
|
'send_newspaper' => $this->send_newspaper,
|
2021-04-11 17:13:56 +02:00
|
|
|
'birthday' => $this->birthday->format('Y-m-d'),
|
|
|
|
'birthday_human' => $this->birthday->format('d.m.Y'),
|
2021-04-11 17:18:28 +02:00
|
|
|
'joined_at' => $this->joined_at->format('Y-m-d'),
|
|
|
|
'joined_at_human' => $this->joined_at->format('d.m.Y'),
|
2021-04-11 11:19:55 +02:00
|
|
|
'id' => $this->id,
|
|
|
|
'gender_id' => $this->gender_id,
|
|
|
|
'further_address' => $this->further_address,
|
|
|
|
'work_phone' => $this->work_phone,
|
|
|
|
'mobile_phone' => $this->mobile_phone,
|
|
|
|
'main_phone' => $this->main_phone,
|
|
|
|
'email' => $this->email,
|
|
|
|
'email_parents' => $this->email_parents,
|
|
|
|
'fax' => $this->fax,
|
|
|
|
'nami_id' => $this->nami_id,
|
2021-04-11 11:44:51 +02:00
|
|
|
'country_id' => $this->country_id,
|
|
|
|
'region_id' => $this->region_id,
|
|
|
|
'nationality_id' => $this->nationality_id,
|
|
|
|
'other_country' => $this->other_country,
|
|
|
|
'confession_id' => $this->confession_id,
|
2021-04-11 02:55:26 +02:00
|
|
|
];
|
2020-06-02 23:45:25 +02:00
|
|
|
}
|
|
|
|
}
|