Reputation:
Any idea how to deal with that? I mean do I need to install or manage some files in my project? I don't know how to manage that? Sorry I am just new in laravel
Upvotes: 1
Views: 7946
Reputation: 1796
I will share two ways
a) In your view add this line in html head
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
and start writing your jquery code in script
tag
b) The other way which i generally prefer is :
In Laravel 5.6 if u look at your package.json
file jquery
is already present as npm dependency so
laravel new my-project
my-project
and run command npm install
. This will install all dependencies included in package.json
including jquery
.public/js/app.js
add the line window.Jquery = require('jquery');
to your resources/assets/js/app.js
run command npm run dev
add line <script src="{{ asset('js/app.js') }}"></script>
to your welcome.blade.php
add this code to your view now.
<script>
$(document).ready(function(){
$(".links").hide();
});
refresh page. you will not see the links below laravel now. which means jquery is up and working
Upvotes: 3