wowowowowo
This commit is contained in:
42
app/Http/Requests/UpdateEnvironmentRequest.php
Normal file
42
app/Http/Requests/UpdateEnvironmentRequest.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use App\Enums\BuildStrategy;
|
||||
use App\Enums\SchedulerMode;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateEnvironmentRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'branch' => ['required', 'string', 'max:255', 'regex:/^[A-Za-z0-9._\/-]+$/'],
|
||||
'status' => ['required', 'string', 'max:255'],
|
||||
'scheduler_enabled' => ['boolean'],
|
||||
'scheduler_target_service_id' => ['nullable', 'integer'],
|
||||
'scheduler_mode' => ['required', Rule::enum(SchedulerMode::class)],
|
||||
'build_strategy' => ['required', Rule::enum(BuildStrategy::class)],
|
||||
'php_version' => ['nullable', 'string', 'max:20'],
|
||||
'document_root' => ['nullable', 'string', 'max:255'],
|
||||
'health_path' => ['nullable', 'string', 'max:255'],
|
||||
'js_package_manager' => ['nullable', 'string', 'max:50'],
|
||||
'js_build_command' => ['nullable', 'string', 'max:255'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user