How to install Bootstrap 4 in Laravel 9?
May 07, 2022 . Admin
Hi Guys,
Today,I will learn you how to install bootstrap 4 in laravel 9, We will show step bty step install bootstrap 4 in laravel 9.we will explain laravel 9 install bootstrap 4. you can see install bootstrap 4 in laravel 9.if you have question about how to use bootstrap in laravel 9 then i will give simple example with solution. you'll learn laravel 9 npm install bootstrap 4. you will do the following things for install bootstrap for laravel 9.
If you are beginner with laravel 9 then i am sure i can help you to install bootstrap 4 in laravel 9. it's very simple way to install using laravel ui composer package. laravel ui package add laravel 9 support.
Laravel ui provide way to install bootstrap, vue and react setup. they also provide auth scaffold for login and register. laravel 9 provide easy way to work with bootstrap, vue and react.
Here, I will give you full install for Bootstrap 4 in laravel 9 as bellow.
Step 1: Download LaravelLet us begin the tutorial by installing a new laravel application. if you have already created the project, then skip following step.
composer create-project laravel/laravel example-app
If you want to install bootstrap 4 in your laravel 9 project then install following laravel ui composer package to get command.
Step 2: Install Laravel uicomposer require laravel/ui
Next successfully install above package then I will ready to install bootstrap 4 with our application.
I can install two way, one is a simple bootstrap 4 setup install and another is install bootstrap 4 with auth. So let's see both way.
Step 3: Install Bootstrap 4php artisan ui bootstrapStep 4: Install Bootstrap 4 with auth
php artisan ui bootstrap --auth
Here we installed bootstrap, you can see your resource directory js folder.
You also need to install npm and run it. so let's run both command.
Step 5: Install NPMnpm installStep 6: Run NPM
npm run dev
Now you can work with your bootstrap 4 in laravel 9 app.
You can use it as like bellow:
<!doctype html> <html> <head> <!-- Scripts --> <script src="{{ asset('js/app.js') }}" defer></script> <!-- Styles --> <link href="{{ asset('css/app.css') }}" rel="stylesheet"> </head> <body> <h1>This is example from Mywebtuts.com</h1> </body> </html>
It will help you...