ok

Mini Shell

Direktori : /home2/selectio/www/limpiar.in.net/app/Http/Resources/V2/
Upload File :
Current File : /home2/selectio/www/limpiar.in.net/app/Http/Resources/V2/PosProductCollection.php

<?php

namespace App\Http\Resources\V2;

use Illuminate\Http\Resources\Json\ResourceCollection;

class PosProductCollection extends ResourceCollection
{
    public function toArray($request)
    {
        return [
            'data' => $this->collection->map(function($data) {
                return [
                    'id' => $data->id,
                    'name' => $data->name,
                    'variant_product' => $data->variant_product,
                    'thumbnail_image' => uploaded_asset($data->thumbnail_img),
                    'price' => single_price($data->unit_price)
                ];
            })
        ];
    }

    public function with($request)
    {
        return [
            'success' => true,
            'status' => 200
        ];
    }
}

Zerion Mini Shell 1.0