Yes, you can integrate Bootstrap into Laravel without using laravel/ui. Here are the steps:
- Install Bootstrap using npm:
npm install bootstrap
-
Create a new SCSS file for your custom variables. For example, create a file called
_custom-variables.scssin yourresources/sassdirectory. -
In your
_custom-variables.scssfile, define your custom variables. For example:
$primary-color: #007bff;
$secondary-color: #6c757d;
-
Create a new SCSS file for your layout. For example, create a file called
layout1.scssin yourresources/sassdirectory. -
In your
layout1.scssfile, import your custom variables and Bootstrap:
@import 'custom-variables';
@import '~bootstrap/scss/bootstrap';
- In your
webpack.mix.jsfile, add the following code to compile your SCSS files:
mix.sass('resources/sass/layout1.scss', 'public/css');
- In your Blade template, include the compiled CSS file:
<link rel="stylesheet" href="{{ asset('css/layout1.css') }}">
- Repeat steps 4-7 for each layout.
Note: If you want to use Bootstrap JavaScript components, you'll need to install the popper.js and jquery packages and include them in your JavaScript file.