How to use PHP within JavaScript on the Laravel framework.

Mahfuzur Rahman - Nov 14 '23 - - Dev Community

Hey Laravel Devs 📢
Do you know? You can use Laravel Blades

{{ }}
Enter fullscreen mode Exit fullscreen mode

in JS and use PHP variables in there.

Image description

Also, You Can Use Route In Ajax URL

Image description

But your JS must be in the Blade file inside the "script" tag.

Laravel #javascript

. . . . . . . . . .
Terabox Video Player