Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Commit f9d58db

Browse files
committed
Merge pull request #8 from 4hl/master
Fix a couple minor gotchas
2 parents f93bca5 + ab86687 commit f9d58db

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/Manavo/BootstrapForms/BootstrapFormsServiceProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ class BootstrapFormsServiceProvider extends IlluminateHtmlServiceProvider
1919
*/
2020
public function boot()
2121
{
22-
$this->package('manavo/bootstrap-forms');
22+
$app = $this->app;
23+
if (version_compare($app::VERSION, '5.0') < 0) {
24+
$this->package('manavo/bootstrap-forms');
25+
}
2326
}
2427

2528
/**

src/Manavo/BootstrapForms/FormBuilder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function closeGroup()
105105
public function input($type, $name, $value = null, $options = [])
106106
{
107107
// Don't add form-control for some input types (like submit, checkbox, radio)
108-
if (!in_array($type, ['submit', 'checkbox', 'radio', 'reset'])) {
108+
if (!in_array($type, ['submit', 'checkbox', 'radio', 'reset', 'file'])) {
109109
$options = $this->appendClassToOptions('form-control', $options);
110110
}
111111

@@ -194,7 +194,6 @@ protected function checkable($type, $name, $value, $checked, $options)
194194
*
195195
* @param string $name
196196
* @param mixed $value
197-
* @param mixed $label
198197
* @param bool $checked
199198
* @param array $options
200199
*
@@ -203,13 +202,14 @@ protected function checkable($type, $name, $value, $checked, $options)
203202
public function checkbox(
204203
$name,
205204
$value = 1,
206-
$label = null,
207205
$checked = null,
208206
$options = []
209207
) {
210208
$checkable = parent::checkbox($name, $value, $checked, $options);
211209

212-
return $this->wrapCheckable($label, 'checkbox', $checkable);
210+
return @$options['label'] ?
211+
$this->wrapCheckable($options['label'], 'checkbox', $checkable) :
212+
$checkable;
213213
}
214214

215215
/**

0 commit comments

Comments
 (0)