How To Validate Select ?

Posted 4 months ago by tanveerkhanwd
//View File:
<select name="gameType">
<option>SELECT GAME TYPE</option>
@forelse($gameType as $results)
    <option value="{{$results->id}}">{{old('gameType')}}{{ $results->name }}</option>
@empty
    <option> No Data Found </option
@endforelse
</select>

// Controller file 
$this->validate($request,[
            'gameType' => 'required',
]);

Please sign in or create an account to participate in this conversation.