Skip to content

Instantly share code, notes, and snippets.

@grandmanitou
Last active May 19, 2022 18:01
Show Gist options
  • Save grandmanitou/851fde816245321eaeb8966178e2c993 to your computer and use it in GitHub Desktop.
Save grandmanitou/851fde816245321eaeb8966178e2c993 to your computer and use it in GitHub Desktop.
Bootstrap 4 custom file input setup with laravel mix
$custom-file-text: (
en: "Browse",
es: "Elegir",
fr: "Parcourir"
);
<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>
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