<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class GruposSuscriptoresRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    protected function prepareForValidation()
    {
        $input = $this->input();
        $input['slug'] = str_slug($input['titulo']);

        $this->replace($input ?? []);
    }

    public function rules(): array
    {
        return [
            'titulo' => 'required|max:125|string',
            'descripcion' => 'required|max:500|string',
        ];
    }
}
