Mar 13, 2024
0
Level 1
Livewire 3 - Validate queryString
I'm looking to validate the sortField and sortDirection in the queryString.
For example sortDirection should only contain 'asc' or 'desc', if the URL is tampered with then the sortDirection should default to 'asc'.
I'm not sure on the conventional way to validate the queryString?
protected function queryString()
{
return [
'sortField' => ['as' => 'f'],
'sortDirection' => ['as' => 'd']];
}
Please or to participate in this conversation.