app/Http/Resources/VentasResource.php
/**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable
     */
Transform the resource into an array.
Transform the resource into an array .
public function toArray($request)
    {
        return [
            'id' => $this->id, 
            'Producto' => $this->Producto, 
            'cantidad' => $this->cantidad, 
            'Precio' => $this->Precio, 
            'total' => $this->total
        ];
    }
public function toArray ( $ request ) { return [ 'id' => $ this -> id , 'Producto' => $ this -> Producto , 'cantidad' => $ this -> cantidad , 'Precio' => $ this -> Precio , 'total' => $ this -> total ] ; }
Transform the resource into an array.
Transform the resource into an array .