$minYear = $attributes['minYear']; } $options = range($minYear, intval(date('Y') + 2)); return Form::selectFormGroup($name, array_combine($options, $options), $title, $formname, $attributes); }); Form::macro('auditoriumFormGroup', function ($name, $title, $formname, $attributes) { $tmp = Filmoteca\Models\Exhibitions\Auditorium::all(['id', 'name'])->lists('name', 'id'); $options = [0 => 'Ninguna']; foreach ($tmp as $key => $value) { $options[$key] = $value; } return Form::selectFormGroup($name, $options, $title, $formname, $attributes); }); Form::macro('theMediaFormGroup', function ($name, $title, $formname, $attributes) { $options = ['TelevisiĆ³n', 'PeriĆ³dico', 'Radio', 'Otro']; return Form::selectFormGroup($name, $options, $title, $formname, $attributes); }); Form::macro('selectFormGroup', function ($name, $options, $title, $formname, $attr) { return "\n" . '<div class="form-group"' . "\n" . ' ng-class="{\'has-error\' : film_form.' . $name . '.$invalid }">' . "\n" . ' <label for="' . $name . '" class="col-sm-2 control-label text-right">' . $title . '</label>' . "\n" . ' <div class="col-sm-10">' . "\n" . Form::select($name, $options, null, $attr) . ' </div>' . "\n" . '</div>' . "\n"; }); /** * By default all the text area inputs have the widget CKEditor. * * If you do not want the CKEditor you must set the $attr['class'] = 'no-ckeditor'. */ Form::macro('textareaFormGroup', function ($name, $title, $formname, $attr) { $attr['class'] = isset($attr['class']) ? $attr['class'] : ''; /** * If it does not has a ckeditor class then we add a full editor. */ if (!Str::contains($attr['class'], 'ckeditor')) {