26 lines
466 B
PHP
26 lines
466 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use App\Models\Note;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
/**
|
|
* @property Note $resource
|
|
*/
|
|
class NoteResource extends JsonResource
|
|
{
|
|
public static $wrap = null;
|
|
|
|
public function toArray($request): array
|
|
{
|
|
return [
|
|
'id' => $this->resource->id,
|
|
'title' => $this->resource->title,
|
|
'note' => $this->resource->note,
|
|
];
|
|
}
|
|
}
|