I am using Laravel mix to compile my assets and combining them into single file. I created a new js file and wrote some methods in this. I combined this file with app.js file. From my blade file when i try to call those methods i get an error function not defined
. I am unable to access those methods.
Please help me out to call those methods.
Laravel Mix code
mix.js([ 'js/app.js',
'js/custom.js'
], 'public/js'),
.....
Custom.js
function test(){
alert('test')
}
test.blade.php
<script type="text/javascript" src="app.js"></script>
<script type="text/javascript">
test();
</script>
Error : test is not defined
app.js
included before you try to usetest();
? – Domingotest()
? I don't see<script src="app.js"></script>
anywhere intest.blade.php
– Domingo