Hi Destructor,
As long as this javascript is within blade it should work just fine, meaning, your code must be inline script.
Another way to go about is, define that url you want to use in your blade view and call it in external javascript. e.g.
At the head of my blade view i would have this:
<script type="text/javascript">
var deletePostUri = "{{ route('delete_post',$post_id)}}";
</script>
Now deletePostUri is globally defined within that page, any javascript inline or external that is loaded after will have access to it.
I hope that helps.
Thanks
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community