mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-05 03:34:36 -04:00
Add SubscriptionStepsController to handle subscription steps
This commit is contained in:
parent
ecda90d5f2
commit
a18f675e64
25
app/Http/Controllers/SubscriptionStepsController.php
Normal file
25
app/Http/Controllers/SubscriptionStepsController.php
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user