mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
31 lines
833 B
PHP
31 lines
833 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 [
|
|
'data' => [
|
|
'id' => $this->slug,
|
|
'type' => 'pages',
|
|
'attributes' => [
|
|
'visibility' => $this->visibility,
|
|
'title' => $this->title,
|
|
'slug' => $this->slug,
|
|
'content' => $this->content,
|
|
'content_formatted' => add_paragraphs($this->content),
|
|
],
|
|
],
|
|
];
|
|
}
|
|
}
|