GenreStoreRequest
class GenreStoreRequest extends FormRequest (View source)
Form request responsible for validating data when creating a new genre.
This request ensures that both the genre name and color code are unique and properly formatted before being persisted to the database.
Methods
Determine if the user is authorized to make this request.
Get the validation rules that apply to the request.
Get the custom messages for validation errors.
Prepare the data for validation by sanitizing and normalizing inputs.
Retrieve only a subset of input data.
Retrieve all input data or a subset.
Determine if the request contains a given input key.
Retrieve an input item from the request.
Merge new input into the request's data.
Details
bool
authorize()
Determine if the user is authorized to make this request.
array
rules()
Get the validation rules that apply to the request.
array
messages()
Get the custom messages for validation errors.
protected void
prepareForValidation()
Prepare the data for validation by sanitizing and normalizing inputs.
This method trims the name field and converts the color hex code to uppercase while removing the leading "#" character if present.
array
only(array|string $keys)
Retrieve only a subset of input data.
array
all(?array $keys = null)
Retrieve all input data or a subset.
bool
has(array|string $key)
Determine if the request contains a given input key.
mixed
input(string $key, mixed $default = null)
Retrieve an input item from the request.
void
merge(array $input)
Merge new input into the request's data.