BenyaminRmb
BenyaminRmb

Reputation: 163

How do I switch to Bootstrap 4 in Laravel 5.5

i want to switch to bootstrap 4 in laravel 5.5 ,

i've run it before :

composer require laravelnews/laravel-twbs4

But I got a bad show in my "auth view" so i run tihs :

php artisan preset bootstrap4-auth

But I still have bad view in my auth view . how can i fix this ?

Upvotes: 2

Views: 1722

Answers (1)

Niket Joshi
Niket Joshi

Reputation: 738

Please follow the below steps for installing bootstrap 4 in Laravel 5.5

To use Bootstrap 4 (BS4), which is in beta at the moment of writing, you will need to take the following steps:

  • Run npm install [email protected] --save-dev to install/overwrite to the latest version

  • Change require('bootstrap-sass') to require('bootstrap') in your bootstrap.js file

  • Change

    @import "~bootstrap-sass/assets/stylesheets/bootstrap"; 
    

    to

    @import "~bootstrap/scss/bootstrap";
    

    in your app.scss file. Also, make sure to remove the reference to variables since these will not work with BS4

  • Run npm run dev in the command line to generate the .css and .js file

Please be aware that the scaffolded auth templates will break due to new class names in BS4, or you can follow this link

Upvotes: 2

Related Questions