first commit
This commit is contained in:
26
app/Http/Resources/CategoryResource.php
Normal file
26
app/Http/Resources/CategoryResource.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use App\Traits\ImageHelper;
|
||||
|
||||
class CategoryResource extends JsonResource
|
||||
{
|
||||
use ImageHelper;
|
||||
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'title' => $this->title,
|
||||
'description' => $this->description,
|
||||
'sortingIndex' => $this->sortingIndex,
|
||||
'isActive' => $this->isActive,
|
||||
'thumbnail' => $this->getFileFullUrl($this->thumbnail),
|
||||
'created_at' => $this->created_at,
|
||||
'updated_at' => $this->updated_at,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user