Can you please show me the html view/code of this form along with these code? it would be easier to debug and find the issue.
Custom macro:
Form::macro("select_nh", function($id, $selected, $attrs){
$vals = array(1, 2, 3, 4, 5);
$arr = array();
foreach($vals as $v){
$arr[$v] = "$v h";
}
return Form::select($id, $arr, $selected, $attrs);
});
View:
{{ Form::select_nh('n-h', 2, ["class" => "required"]) }}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community