feat: paginate workshops and videos pages

This commit is contained in:
Xavier Oliveira
2026-05-27 09:24:10 +01:00
parent da0baaee15
commit 68f99798ce
72 changed files with 3352 additions and 1044 deletions

View File

@@ -19,6 +19,16 @@ class CreateVideoRequest extends FormRequest
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
protected function prepareForValidation(): void
{
if ($this->has('order')) {
$this->merge([
'order' => (int) $this->order
]);
}
}
public function rules(): array
{
return [
@@ -29,6 +39,7 @@ class CreateVideoRequest extends FormRequest
'duration' => 'nullable|string|max:10',
'tags' => 'nullable|string|max:255', // nullable para não ser obrigatório
'category_ids' => 'nullable|array|exists:categories,id', // nullable caso não selecione
'order' => 'nullable|integer|min:0',
];
}
@@ -47,6 +58,8 @@ class CreateVideoRequest extends FormRequest
'thumbnail.max' => 'A thumbnail deve ter no máximo 4MB',
'tags.max' => 'As tags devem ter no máximo 50 caracteres',
'category_id.exists' => 'A categoria não existe',
'order.integer' => 'O ordem deve ser um número inteiro',
'order.min' => 'A ordem deve ser maior ou igual a 0',
];
}
}