Closed benkelukas closed 6 years ago
Are you using latest package version and stable bs4 ?
Hi, yes
the version of package is (from composer.lock
)
"name": "marvinlabs/laravel-html-bootstrap-4",
"version": "v0.8.1",
version of bootstrap is (from yarn.lock
)
bootstrap@4.0.0:
version "4.0.0"
I cannot reproduce it on my workbench. Are the messages in the html source? Or fully omitted?
Have you tried putting some breakpoints in the source code to see what was going on?
Here is some code that works:
{{ bs()->formGroup()
->control(bs()->inputGroup()
->suffix(fa()->icon('user'))
->control(bs()->text('last_name', 'Doe')))
->label('Last name') }}
In the prefix/suffix, you don't need the wrapper span, only the icon element is required.
Sample code is there:
Hi, thanks a lot for Your help and sorry for the issue, I've thought that i do not need to use form group when using input group, my bad.
However i cannot use the fa()
helper, i get undefined function error, i have searched for the function in repo and could not find it, so i used the wrapper span instead.
Oh,
I got that.
You have not wrapped the controls within form groups.
Form groups are the ones which display the error messages.
That should work:
<div class="row mb-3">
{!! bs()->formGroup(bs()->text('first_name')
->placeholder(__('core::register.form.first_name')))
->addClass("col-6") !!}
{!! bs()->formGroup(bs()->text('last_name')
->placeholder(__('core::register.form.last_name')))
->addClass("col-6") !!}
</div>
{!! bs()->formGroup(bs()->inputGroup()
->prefix("<i class='icon-user'></i>", false)
->control(bs()->email('email')->placeholder(__('core::register.form.email'))))
->addClass('mb-3') !!}
{!! bs()->formGroup(bs()->inputGroup()
->addClass('mb-3')
->prefix('<i class="icon-lock"></i>', false)
->control(bs()->password('password')->placeholder(__('core::register.form.password'))))
->addClass('mb-3') !!}
{!! bs()->formGroup(bs()->inputGroup()
->addClass('mb-3')
->prefix('<i class="icon-lock"></i>', false)
->control(bs()->password('password_confirmation')->placeholder(__('core::register.form.password_confirmation'))))
->addClass('mb-3') !!}
The fa()
function comes from another package I made in the same spirit: https://github.com/marvinlabs/laravel-html-font-awesome
Awesome, thanks again for quick support.
You're welcome. Let me know if there are missing features. Do not hesitate to submit a few pull requests if you can.
Well, maybe the https://github.com/marvinlabs/laravel-html-font-awesome should either be mentioned in documentation or defined as dependency in composer.json
- it is used in examples, but there is not information from where the helper fa()
comes from. What do you think about that?
Clearly it should not be added as a dependency (no need for that package to use this one).
Regarding the samples, they are located on my package workbench project (not this package project), this is why I use other packages there.
By the way, I just published a menu package for BS 4, that may be of interest for you.
Hi, first of all, thanks for this awesom package, it is just what i was looking for.
However, I'm having a slight issue regarding validation and showing error messages. Right now, if validation fails, the fields get correct is-invalid class but i cannot see the error message from the validator (e.g. Field :field is required).
Here is my code:
And here is a screenshot after failed validation:![screenshot-2018-3-13 coreui - open source bootstrap admin template](https://user-images.githubusercontent.com/6639728/37354391-d9f60754-26e1-11e8-8d0b-0ba3c851a5e7.png)
Do i need to do something more for the error messages to show up?
Thanks