Last active
May 19, 2022 18:01
-
-
Save grandmanitou/851fde816245321eaeb8966178e2c993 to your computer and use it in GitHub Desktop.
Bootstrap 4 custom file input setup with laravel mix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$custom-file-text: ( | |
en: "Browse", | |
es: "Elegir", | |
fr: "Parcourir" | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="input-group mb-3"> | |
<div class="custom-file"> | |
<input type="file" class="custom-file-input" id="file" name="file" lang="fr"> | |
<label class="custom-file-label" for="file" aria-describedby="fichiers">Sélectionner les fichiers</label> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mix = require('laravel-mix'); | |
/* | |
|-------------------------------------------------------------------------- | |
| Mix Asset Management | |
|-------------------------------------------------------------------------- | |
| | |
| Mix provides a clean, fluent API for defining some Webpack build steps | |
| for your Laravel application. By default, we are compiling the Sass | |
| file for the application as well as bundling up all the JS files. | |
| | |
*/ | |
mix.scripts([ | |
'node_modules/jquery/dist/jquery.min.js', | |
'node_modules/bootstrap/dist/js/bootstrap.min.js', | |
'node_modules/bs-custom-file-input/dist/bs-custom-file-input.min.js', | |
], 'public/js/vendor.js'); | |
mix.js('resources/js/app.js', 'public/js'); | |
mix.sass('resources/sass/app.scss', 'public/css'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment