feat: paginate workshops and videos pages
This commit is contained in:
@@ -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',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user