app/Http/Resources/PlanResource.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,
            "plan_label" => $this->name,
            "plan_fee" => $this->fee,
            "plan_validity" => $this->validity,
            "status" => $this->status,
            "created_at" => $this->created_at
        ];
    }
public function toArray ( $ request ) { return [ " id " => $ this -> id , " plan_label " => $ this -> name , " plan_fee " => $ this -> fee , " plan_validity " => $ this -> validity , " status " => $ this -> status , " created_at " => $ this -> created_at ] ; }
Transform the resource into an array.
Transform the resource into an array .