Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SigalZ's avatar

Laravel 10 with bootstrap 3

Hello,

I am trying to convert a laravel 5.4 site to laravel 10. I installed laravel 10 and I don't want to change the design so I need to install bootstrap 3 and jquery with it.

I can't find a way to do this.

I tried following a few tutorials but they all use bootstrap 5.

I tried using vite and keep getting and error that jQuery is not defined. I think I made a big mass with all the tutorials so maybe someone here can give me the rights steps?

What I have now:

I installed jquery with npm so I have node_modules/jquery folder

I copied the node_modules/bootstrap-sass from the old site

In resources/app.js file:

import jQuery from 'jquery';

window.$ = jQuery;	

require('./bootstrap');

In resources/bootstrap.js file:

/**
 * We'll load the axios HTTP library which allows us to easily issue requests
 * to our Laravel back-end. This library automatically handles sending the
 * CSRF token as a header based on the value of the "XSRF" token cookie.
 */

import axios from 'axios';
window.axios = axios;

window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

window._ = require('lodash');

I ran npm run build and npm run dev. No idea what I'm doing... Can someone please help?

0 likes
4 replies
Snapey's avatar

you can ignore vite and just put links to the cdn for each package in the head of your master layout - exactly as you would have done in laravel 5.4

2 likes
SigalZ's avatar

@Snapey I used mix in 5.4 not cdn links, but I guess, to make things fast and easy I'll try the cdn links. Thanks :)

1 like
vincent15000's avatar

And why not upgrade to the last Bootstrap's version ?

This will not alter the design, you will just need to update some parts of the code.

SigalZ's avatar

@vincent15000 I will in the future when I create new code. Right now, I want to do this transfer as fast as possible Thanks :)

1 like

Please or to participate in this conversation.