File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -243,16 +243,7 @@ protected function getAvailablePlans($runtime = false)
243243 return (array ) $ this ->config ()->get ('service.available_plans ' );
244244 }
245245
246- $ plans = [];
247- foreach ($ this ->api ()->getClient ()->getPlans () as $ plan ) {
248- if ($ plan ->hasProperty ('price ' , false )) {
249- $ plans [$ plan ->name ] = sprintf ('%s (%s) ' , $ plan ->label , $ plan ->price ->__toString ());
250- } else {
251- $ plans [$ plan ->name ] = $ plan ->label ;
252- }
253- }
254-
255- return $ plans ;
246+ return $ plans = $ this ->api ()->getClient ()->getSetupOptions ()->plans ;
256247 }
257248
258249 /**
@@ -311,7 +302,11 @@ protected function getFields()
311302 'optionsCallback ' => function () {
312303 return $ this ->getAvailablePlans (true );
313304 },
314- 'default ' => in_array ('development ' , $ this ->getAvailablePlans ()) ? 'development ' : null ,
305+ // @todo ensure the default is based on the dynamic list and works during resolveOptions()
306+ //'default' => 'development',
307+ 'defaultCallback ' => function () {
308+ return in_array ('development ' , $ this ->getAvailablePlans (true )) ? 'development ' : null ;
309+ },
315310 'allowOther ' => true ,
316311 ]),
317312 'environments ' => new Field ('Environments ' , [
You can’t perform that action at this time.
0 commit comments