Issue
All of the info I can find online says that you should install bootstrap by running composer require laravel/ui
and then php artisan ui boostrap
. However, in Laravel 8, laravel/ui
is deprecated. Is there a new/better way of installing bootstrap?
Solution
You can install bootstrap manually and compile sass.
First, add it to npm with compilers:
npm install bootstrap
npm install sass
npm install sass-loader
Second, create (if not created) resources/sass/app.scss and add this:
@import '~bootstrap';
Third, add compilation in webpack.mix.js:
mix.sass('resources/sass/app.scss', 'public/css')
Than, compile it with npm run dev - you see compiled file public/css/app.css
Now you can use it in templates with asset:
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
Answered By - Maksim
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.