AlpineJS is very popular addition to Laravel ecosystem and here is the easiest way how to install AlpineJS to Laravel:

1. install alpine, run this command in your terminal

                    npm install alpinejs

2. Initiate Alpine JS in your app.js file:


// add these files bellow
import Alpine from 'alpinejs';
window.Alpine = Alpine;

3. recompile your JS files

                    // for dev
npm run watch 

// or for prod
npm run prod

4.include app.js in your template

                    <script defer src="{{ mix('static/js/app.js') }}" crossorigin="anonymous" referrerpolicy="no-referrer"></script>