Code for similar option not allowing in a question...
$uniqueArray = $request->get('answer_option');
if(count(array_unique($uniqueArray)) != count($request->get('answer_option'))){
Session::flash('error', 'Similar option is not allow for a question.');
return redirect()->back()->withInput();
}
No comments:
Post a Comment