Some checks failed
continuous-integration/drone/push Build is failing
- Complete GGZ Ecademy Laravel backend application - RESTful API for learning products, members, filters - Authentication and authorization system - Database migrations and seeders - Custom CRUD generator commands - Email notification system - Integration with frontend applications
29 lines
760 B
PHP
29 lines
760 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class PageResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return array
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'title' => $this->title,
|
|
'subtitle' => $this->subtitle,
|
|
'published_at' => $this->updated_at->toDateTimeString(),
|
|
'created_at' => $this->updated_at->toDateTimeString(),
|
|
'updated_at' => $this->created_at->toDateTimeString(),
|
|
'slug' => $this->slug,
|
|
'components' => $this->whenLoaded('components'),
|
|
];
|
|
}
|
|
}
|