37 lines
1.4 KiB
PHP
37 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Resources\SousTraitant;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
class SousTraitantResource extends JsonResource
|
|
{
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'nom_entreprise' => $this->nom_entreprise,
|
|
'siret' => $this->siret,
|
|
'forme_juridique' => $this->forme_juridique,
|
|
'code_ape' => $this->code_ape,
|
|
'adresse' => $this->adresse,
|
|
'contact_principal' => $this->contact_principal,
|
|
'telephone' => $this->telephone,
|
|
'email' => $this->email,
|
|
'site_web' => $this->site_web,
|
|
'numero_contrat' => $this->numero_contrat,
|
|
'montant_contrat' => $this->montant_contrat,
|
|
'date_debut_contrat' => $this->date_debut_contrat?->format('Y-m-d'),
|
|
'date_fin_contrat' => $this->date_fin_contrat?->format('Y-m-d'),
|
|
'type_prestation' => $this->type_prestation,
|
|
'conditions_paiement' => $this->conditions_paiement,
|
|
'statut' => $this->statut,
|
|
'note_qualite' => $this->note_qualite,
|
|
'certifications_labels' => $this->certifications_labels ?? [],
|
|
'created_at' => $this->created_at?->format('Y-m-d H:i:s'),
|
|
'updated_at' => $this->updated_at?->format('Y-m-d H:i:s'),
|
|
];
|
|
}
|
|
}
|