mirror of
https://github.com/tiennm99/coolify.git
synced 2026-09-04 00:17:15 +00:00
Move V5 source, migrations, UI, scripts, and tests into documentation, then remove V5 routes, models, jobs, configuration, dependencies, and application hooks.
31 lines
697 B
Plaintext
31 lines
697 B
Plaintext
<?php
|
|
|
|
namespace App\Http\Controllers\V5\Concerns;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
trait ValidatesBuilderConfiguration
|
|
{
|
|
/**
|
|
* @return array<int, string>
|
|
*/
|
|
protected function builderCapacityRules(bool $builderEnabled, bool $required = false): array
|
|
{
|
|
return [
|
|
$required ? 'required' : 'sometimes',
|
|
'integer',
|
|
$builderEnabled ? 'min:1' : 'min:0',
|
|
'max:1000',
|
|
];
|
|
}
|
|
|
|
protected function requestedBuilderEnabled(Request $request, bool $default): bool
|
|
{
|
|
if (! $request->has('builder_enabled')) {
|
|
return $default;
|
|
}
|
|
|
|
return $request->boolean('builder_enabled');
|
|
}
|
|
}
|