34 lines
1.1 KiB
PHP
34 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreVersionRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'version' => ['required', 'string', 'max:32'],
|
|
'changelog' => ['nullable', 'string'],
|
|
'typecho_min' => ['nullable', 'string', 'max:16'],
|
|
'typecho_max' => ['nullable', 'string', 'max:16'],
|
|
'php_min' => ['nullable', 'string', 'max:16'],
|
|
'php_max' => ['nullable', 'string', 'max:16'],
|
|
'php_extensions' => ['nullable', 'array'],
|
|
'php_extensions.*' => ['string', 'max:32'],
|
|
'package_url' => ['required', 'url', 'max:1024'],
|
|
'package_size' => ['nullable', 'integer', 'min:0'],
|
|
'sha256' => ['required', 'string', 'size:64'],
|
|
'is_stable' => ['nullable', 'boolean'],
|
|
'published_at' => ['nullable', 'date'],
|
|
'mark_as_latest' => ['nullable', 'boolean'],
|
|
];
|
|
}
|
|
}
|