In my project I want use validator to check already exist. Works fine for single existence. But in model add I want to check the same model should not exist with same type and make.with diff make or type it will be ok but not with same.
$input['name'] = Input::get('name');
$rules = array('name' => "unique:types,name");
$validator = Validator::make($input, $rules);
if ($validator->fails()) {
return Redirect::back()->with('alert-danger',"Type Name already exist.")->withInput();
} else {
$type = new Type();
$type_detail = $type->add_type($request);
$data['name'] = $request->name;
return redirect('/types')->with('alert-success', 'Type Created successfully.');
}