Level 70
What is new CountryRule?
I have a suggestion for you.
Never call model in your blade. It's not a best practice.
Hi experts,
My HTML blade for Select:
@foreach(App\Model\Master\Country::all() as $country)
<option value='{{$country->id}}'>
{{$country->name}}
</option>
@endforeach
My validatoin rule:
'country' => ['required',new CountryRule],
This will return false if user enters(spoofs) incorrect id in HTML request. I can test it manually by entering incorrect id in the value of the selected option in HTML request.
But I want to create a test case with Dusk. How can I do it?
Please or to participate in this conversation.