1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 21:52:35 +01:00
invoiceninja/app/Http/Controllers/SubscriptionStepsController.php

26 lines
705 B
PHP
Raw Normal View History

<?php
namespace App\Http\Controllers;
use App\Livewire\BillingPortal\Purchase;
use Illuminate\Http\JsonResponse;
class SubscriptionStepsController extends BaseController
{
public function index(): JsonResponse
{
// @todo: perhaps integrate this in statics
$dependencies = collect(Purchase::$dependencies)
->map(fn($dependency) => [
'id' => $dependency['id'],
'dependencies' => collect($dependency['dependencies'])
->map(fn($dependency) => Purchase::$dependencies[$dependency]['id'])
->toArray(),
])
->toArray();
return response()->json($dependencies);
}
}