mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-11 21:52:35 +01:00
26 lines
705 B
PHP
26 lines
705 B
PHP
|
<?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);
|
||
|
}
|
||
|
}
|