I guess you don't even to have to build a custom validation rule.
Just by using the Exists built-in validation rule : http://laravel.com/docs/validation#rule-exists
Like in your case :
$country_id = Input::get('country_id')
'country_id' => "exists:Countries,id,$country_id"
With the validator :
$validator = Validator::make(
array(
'country_id' => $country_id,
),
array(
'country_id' => "exists:Countries,id,$country_id"
)
);
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community