Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/SignupController.php
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | public function plans(Request $request) | ||||
$plans = []; | $plans = []; | ||||
// Use reverse order just to have individual on left, group on right ;) | // Use reverse order just to have individual on left, group on right ;) | ||||
Plan::withEnvTenantContext()->orderByDesc('title')->get() | Plan::withEnvTenantContext()->orderByDesc('title')->get() | ||||
->map(function ($plan) use (&$plans) { | ->map(function ($plan) use (&$plans) { | ||||
$plans[] = [ | $plans[] = [ | ||||
'title' => $plan->title, | 'title' => $plan->title, | ||||
'name' => $plan->name, | 'name' => $plan->name, | ||||
'button' => __('app.planbutton', ['plan' => $plan->name]), | 'button' => \trans('app.planbutton', ['plan' => $plan->name]), | ||||
'description' => $plan->description, | 'description' => $plan->description, | ||||
]; | ]; | ||||
}); | }); | ||||
return response()->json(['status' => 'success', 'plans' => $plans]); | return response()->json(['status' => 'success', 'plans' => $plans]); | ||||
} | } | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 389 Lines • Show Last 20 Lines |