Support the ongoing development of →
Input Blade
Last updated 2 years ago.

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)}}";

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.


Last updated 8 years ago.

Thanks for help :)


Isn't it vulnerable to CSRF?


Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.