Lompat ke konten Lompat ke sidebar Lompat ke footer

Cara pasang bootstrap pertama kali di laravel 10

composer require laravel/ui --dev

php artisan ui bootstrap --auth

npm install bootstrap-icons --save-dev

npm install

npm run build 


Step 1: vite.config.js

Vite works best without CSS entry points:

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
plugins: [

Step 2: resources/js/app.js

Instead, you should import your CSS via JavaScript. Typically, this would be done in your application's resources/js/app.js file:

import './bootstrap';
import '../css/app.css';

Step 3: Layouts

If you're importing your CSS via JavaScript, you only need to include the JavaScript entry point:

<!doctype html>
{{-- ... --}}

Step 4: Build

Running the build command will version and bundle your application's assets and get them ready for you to deploy to production:

# Build and version the assets for production...
npm run build

Well done!

php artisan optimize:clear