25 lines
577 B
PHP
25 lines
577 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Resources;
|
||
|
|
|
||
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||
|
|
|
||
|
|
class CategoryResource extends JsonResource
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* Transform the resource into an array.
|
||
|
|
*
|
||
|
|
* @param \Illuminate\Http\Request $request
|
||
|
|
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
|
||
|
|
*/
|
||
|
|
public function toArray($request)
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'id' => $this->id,
|
||
|
|
'name_en' => $this->name_en,
|
||
|
|
'name_ru' => $this->name_ru,
|
||
|
|
'name_tm' => $this->name_tm
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|