39 lines
1.3 KiB
PHP
39 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Resources;
|
|
|
|
use Illuminate\Http\Resources\Json\ResourceCollection;
|
|
|
|
class XmlIncoCollection extends ResourceCollection
|
|
{
|
|
/**
|
|
* Transform the resource collection into an array.
|
|
*
|
|
* @param mixed $request
|
|
* @return array
|
|
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
|
|
*/
|
|
public function toArray($request)
|
|
{
|
|
return $this->collection->map(function ($xmlInco) {
|
|
return [
|
|
'label' => $xmlInco->nice_string,
|
|
'value' => $xmlInco->id,
|
|
'no_art' => $xmlInco->no_art,
|
|
'prod_saison' => $xmlInco->prod_saison,
|
|
'allegations' => $xmlInco->allegations,
|
|
'conseil_prepa' => $xmlInco->conseil_prepa,
|
|
'astuces' => $xmlInco->astuces,
|
|
'descriptif' => $xmlInco->descriptif,
|
|
'arg_vente' => $xmlInco->arg_vente,
|
|
'nb_portion' => $xmlInco->nb_portion,
|
|
'typ_portion' => $xmlInco->typ_portion,
|
|
'pds_moy_theo' => $xmlInco->pds_moy_theo,
|
|
'lib_conso' => $xmlInco->lib_conso,
|
|
'lst_ing' => $xmlInco->lst_ing,
|
|
'nutritional_values' => $xmlInco->nutritional_values,
|
|
'picture' => $xmlInco->picture,
|
|
];
|
|
})->all();
|
|
}
|
|
}
|