Create invoice form part 1.

This commit is contained in:
Peter Papp
2021-04-30 17:53:19 +02:00
parent 5167ae520e
commit 3c3e82758d
51 changed files with 1890 additions and 763 deletions

View File

@@ -1,12 +1,9 @@
<?php
namespace App\Http\Resources\Oasis;
use App\Http\Resources\PlanResource;
use App\Http\Resources\PricingResource;
use App\Services\StripeService;
use App\Http\Resources\PricingResource;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Facades\Cache;
class SubscriptionRequestResource extends JsonResource
{
@@ -20,34 +17,34 @@ class SubscriptionRequestResource extends JsonResource
{
return [
'data' => [
'id' => $this->id,
'type' => 'subscription-requests',
'attributes' => [
'requested_plan' => $this->requested_plan,
'status' => $this->status,
'id' => $this->id,
'type' => 'subscription-requests',
'attributes' => [
'requested_plan' => $this->requested_plan,
'status' => $this->status,
'created_at_formatted' => format_date($this->created_at, '%d. %B. %Y'),
],
'relationships' => [
'user' => [
'data' => [
'id' => $this->user->id,
'type' => 'users',
'id' => $this->user->id,
'type' => 'users',
'attributes' => [
'name' => $this->user->settings->name,
'address' => $this->user->settings->address,
'state' => $this->user->settings->state,
'city' => $this->user->settings->city,
'postal_code' => $this->user->settings->postal_code,
'country' => $this->user->settings->country,
'name' => $this->user->settings->name,
'address' => $this->user->settings->address,
'state' => $this->user->settings->state,
'city' => $this->user->settings->city,
'postal_code' => $this->user->settings->postal_code,
'country' => $this->user->settings->country,
'phone_number' => $this->user->settings->phone_number,
'ico' => $this->user->settings->ico,
]
]
'ico' => $this->user->settings->ico,
],
],
],
'plan' => new PricingResource(
resolve(StripeService::class)->getPlan($this->requested_plan)
),
]
],
],
];
}