for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Http\Resources\enso\people;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Facades\Config;
use LaravelEnso\People\Enums\Titles;
class Person extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
return [
'id' => $this->id,
id
App\Http\Resources\enso\people\Person
__get
'name' => $this->name,
name
'appellative' => $this->appellative,
appellative
'birthday' => optional($this->birthday)->format(Config::get('config.enso.dateFormat')),
birthday
'title' => Titles::get($this->title),
title
'phone' => $this->phone,
phone
];
}