mirror of
https://github.com/tiennm99/coolify.git
synced 2026-09-13 18:19:02 +00:00
Split V5 dashboard behavior into domain controllers and policies, add agent token rotation/revocation, status reconciliation jobs, ingress firewall syncing, and canvas connection APIs. Add migrations for V5 status tracking, server capabilities, resource connection aliases, and revoked agent tokens.
31 lines
697 B
PHP
31 lines
697 B
PHP
<?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');
|
|
}
|
|
}
|