for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class WorldResource extends JsonResource
{
public function toArray($request)
$data = [
'id' => $this->id,
id
App\Http\Resources\WorldResource
__get
'galaxy_id' => $this->galaxy_id,
galaxy_id
'map_id' => $this->map_id,
map_id
'name' => $this->name,
name
'display_name' => $this->display_name,
display_name
];
if (!empty($this->updated_at)) {
updated_at
$data['update_at'] = $this->updated_at->format('Y-m-d H:i:s');
}
return $data;