mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01: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…
Reference in New Issue
Block a user