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,
|
|
|
|
'birthday' => $this->birthday->format('d.m.Y'),
|
|
|
|
'joined_at' => $this->joined_at->format('d.m.Y'),
|
|
|
|
];
|
2020-06-02 23:45:25 +02:00
|
|
|
}
|
|
|
|
}
|