I have form that a user can fill-out for selling their home. And for one of the in puts, a user must select weather it will be \"For Sale\" or \"For Rent\". If it is For Sal
You can use Illuminate\Validation\Rule in Laravel as given below to build the validator.
$validator = Validator::make( $request->input(), [
'list_type' => 'required',
'sale_price'=> Rule::requiredIf( function () use ($request){
return $request->input('list_type') == 'For Sale';
}),
'rent_price'=> Rule::requiredIf( function () use ($request){
return $request->input('list_type') == 'For Rent';
}),
]);