for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Innoflash\Events\Http\Resources;
use Carbon\Carbon;
use FaithGen\SDK\Helpers\ImageHelper;
use Illuminate\Http\Resources\Json\JsonResource;
use InnoFlash\LaraStart\Helper;
class Event extends JsonResource
{
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public function toArray($request)
return [
'id' => $this->id,
id
Innoflash\Events\Http\Resources\Event
__get
'name' => $this->name,
name
'published' => $this->published,
published
'location' => $this->location,
location
'description' => $this->description,
description
'start' => Helper::getDates($this->start),
start
'end' => Helper::getDates($this->end),
end
'is_past' => Carbon::parse($this->end)->isPast(),
'avatar' => ImageHelper::getImage('events', $this->image, config('faithgen-sdk.ministries-server')),
image
'date' => Carbon::parse($this->start)->format('Y/m/d'),
];
}