app/Http/Resources/ProductosResource.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, 
            'categoria_id' => $this->categoria_id, 
            'producto' => $this->producto, 
            'costo_unitario' => $this->costo_unitario, 
            'precio_unitario' => $this->precio_unitario, 
            'existencias' => $this->existencias, 
            'descripcion' => $this->descripcion, 
            'imagen' => $this->imagen, 
            'estatus' => $this->estatus
        ];
    }
public function toArray ( $ request ) { return [ 'id' => $ this -> id , 'categoria_id' => $ this -> categoria_id , 'producto' => $ this -> producto , 'costo_unitario' => $ this -> costo_unitario , 'precio_unitario' => $ this -> precio_unitario , 'existencias' => $ this -> existencias , 'descripcion' => $ this -> descripcion , 'imagen' => $ this -> imagen , 'estatus' => $ this -> estatus ] ; }
Transform the resource into an array.
Transform the resource into an array .