I want to add environment variable key in my bootstrap.js file (in laravel), but the php tags are recognised as strings.
My resources/js/bootstrap.js file
$(document).on('change', '#country', function(event){
var key = '<?php echo config("app.key"); ?>';
console.log('key: '+ key);
});
//out put in console
// key: '<?php config("app.name"); ?>';
Please guide me on this.