n How to install Bootstrap 4 in Laravel | CodimTh

Please Disable Your Browser Adblock Extension for our site and Refresh This Page!

our ads are user friendly, we do not serve popup ads. We serve responsible ads!

Refresh Page
Skip to main content
On . By CodimTh
Category:

If you want to install bootstrap 4 in your laravel 7 project then install following laravel ui composer package to get command:

composer require laravel/ui

After successfully install above package then we are ready to install bootstrap 4 with our application.

we 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.

 

Install Bootstrap 4

php artisan ui bootstrap

Install Bootstrap 4 with auth

php artisan ui bootstrap --auth

Now 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:

Install NPM

npm install

 

Run NPM

npm run dev

Now you can work with your bootstrap 4 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>Lorem ipsum</h1>

</body>

</html>

 

Riadh Rahmi

Senior Web Developer PHP/Drupal & Laravel

I am a senior web developer, I have experience in planning and developing large scale dynamic web solutions especially in Drupal & Laravel.

Web Posts

Search

Page Facebook