27 lines
701 B
PHP
27 lines
701 B
PHP
<?php
|
|
|
|
namespace App\Http\Resources\Panel;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class RelationWordResource extends JsonResource
|
|
{
|
|
/**
|
|
* Transform the resource into an array.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'wordRelated' => $this->relatedWord?->word,
|
|
'wordRelated_id' => $this->relatedWord?->id,
|
|
'description' => $this->description,
|
|
'relation_type' => $this->relation_type,
|
|
'created_at' => verta($this->created_at)->format('%d %B %Y %H:%M:%S'),
|
|
];
|
|
}
|
|
}
|