Skip to content

Latest commit

 

History

History
40 lines (25 loc) · 984 Bytes

file.md

File metadata and controls

40 lines (25 loc) · 984 Bytes

Files

Bootstrap documentation

Remember to open the form using the 'files' => true option. Else your files will not be submitted.

Custom file control

By default, we output custom file controls. Which has its own problems though.

Here is a quote from the bootstrap documentation:

The file input is the most gnarly of the bunch and requires additional JavaScript if you’d like to hook them up with functional Choose file… and selected file name text.

{{ bs()->file('avatar2', 'Select a file') }}

Default file control

But you can also insert default file inputs too. Those ones are ugly but properly show the selected file name.

{{ bs()->simpleFile('avatar') }}

Wrapped inside a form group

It can be wrapped inside a form group if needed.

{{ bs()->formGroup()
       ->label('Username')
       ->control(bs()->file('avatar2', 'Pick a file')) }}