Fantastic info. Thanks, @w1n78.
Jan 24, 2017
21
Level 6
Tip: Using Bootstrap 4 alpha 6 with Laravel 5.4
just wanted to share what i did to be able to use bootstrap 4 alpha 6 with laravel 5.4. i did this on an empty project.
- remove the bootstrap entry from package.json and replace it with
"bootstrap": "4.0.0-alpha.6", - in resources/assets/sass/app.scss, comment out the import of variables. change the path of bootstrap to
@import "node_modules/bootstrap/scss/bootstrap.scss"; - in resources/assets/js/bootstrap.js, look for
require('bootsrap-sass');and change it torequire('bootstrap');
bring in the javascript by editing the webpack.mix.js
mix.js([
'node_modules/jquery/dist/jquery.min.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'resources/assets/js/app.js'
], 'public/js/app.js')
.sass('resources/assets/sass/app.scss', 'public/css/app.css');
if all goes well, you should be able to run npm run dev.
if you're going to use pagination, you will need to use the template included with laravel for bootstrap 4. by default, it uses bootstrap 3.
php artisan vendor:publish --tag=laravel-pagination
// Copied Directory [/vendor/laravel/framework/src/Illuminate/Pagination/resources/views] To [/resources/views/vendor/pagination]
you can check out https://laravel.com/docs/5.4/pagination#customizing-the-pagination-view for more info.
just keep in mind that bootstrap is still in alpha and will have plenty of changes. i just wanted to share this for those curious.
Please or to participate in this conversation.