app/Http/Resources/CommentaireRessource.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,
            "investissement_id" => $this->investissement_id,
            "user" => $this->user,
            "description"=> $this->description,
        ];
    }
public function toArray ( $ request ) { return [ " id " => $ this -> id , " investissement_id " => $ this -> investissement_id , " user " => $ this -> user , " description " => $ this -> description , ] ; }
Transform the resource into an array.
Transform the resource into an array .