feat: plans create/edit keep back and return
This commit is contained in:
@@ -142,12 +142,16 @@ class PlanController extends Controller
|
||||
{
|
||||
$this->ensurePlatformAdmin($request);
|
||||
|
||||
$back = (string) $request->query('back', '');
|
||||
$safeBack = str_starts_with($back, '/') ? $back : '';
|
||||
|
||||
return view('admin.plans.form', [
|
||||
'plan' => new Plan(),
|
||||
'statusLabels' => $this->statusLabels(),
|
||||
'billingCycleLabels' => $this->billingCycleLabels(),
|
||||
'formAction' => '/admin/plans',
|
||||
'method' => 'post',
|
||||
'back' => $safeBack,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -165,12 +169,16 @@ class PlanController extends Controller
|
||||
{
|
||||
$this->ensurePlatformAdmin($request);
|
||||
|
||||
$back = (string) $request->query('back', '');
|
||||
$safeBack = str_starts_with($back, '/') ? $back : '';
|
||||
|
||||
return view('admin.plans.form', [
|
||||
'plan' => $plan,
|
||||
'statusLabels' => $this->statusLabels(),
|
||||
'billingCycleLabels' => $this->billingCycleLabels(),
|
||||
'formAction' => '/admin/plans/' . $plan->id,
|
||||
'method' => 'post',
|
||||
'back' => $safeBack,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user