notifications ready fx11
This commit is contained in:
parent
0c6074c412
commit
ca4986dec3
|
|
@ -4,7 +4,7 @@ namespace Sarga\API\Http\Resources\Catalog;
|
|||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Sarga\API\Http\Resources\Core\Vendor as VendorResource;
|
||||
|
||||
class Category extends JsonResource
|
||||
{
|
||||
/**
|
||||
|
|
@ -22,7 +22,7 @@ class Category extends JsonResource
|
|||
'slug' => $this->slug,
|
||||
'display_mode' => $this->display_mode,
|
||||
'image_url' => $this->image_url,
|
||||
'vendors' => VendorResource::collection($this->vendors),
|
||||
'vendors' => CategoryVendor::collection($this->vendors),
|
||||
'category_icon_path' => $this->category_icon_path
|
||||
? Storage::url($this->category_icon_path)
|
||||
: null,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace Sarga\API\Http\Resources\Catalog;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class CategoryVendor extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'shop_title' => $this->shop_title,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Sarga\API\Http\Resources\Catalog;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class VendorCategory extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'display_mode' => $this->display_mode,
|
||||
'image_url' => $this->image_url,
|
||||
'children' => Category::collection($this->children),
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue