Example #1
0
    return Form::selectField($name, $label, $options, $value, $attributes);
});
/**
 * Bootstrap Select Input populated from Eloquent Model Query
 * @param string = HTML Field Name
 * @param string = null
 * @param string = null
 * @param array = ['name']
 * @param string = null
 * @param array = []
 *
 * @return string
 */
Form::macro('selectDBField', function ($name, $label = null, $model = null, $display_items = ['name'], $value = null, $attributes = array()) {
    $options = getOptionsFromDB($model, $display_items);
    return Form::selectField($name, 'Select ' . $label . ':', $options, $value, $attributes);
});
/**
 * Bootstrap Checkbox Input With Hidden Field
 * @param string = HTML Field Name
 * @param string = null
 * @param string = 1
 * @param string = null
 * @param array = []
 *
 * @return string
 */
Form::macro('checkboxField', function ($name, $label = null, $value = 1, $checked = null, $attributes = array()) {
    $attributes = array_merge(['id' => 'id-field-' . $name], $attributes);
    $out = "<!-- {$label} Checkbox -->";
    $out .= '<div class="checkbox';