i am trying to include laravel .env variable into my js file my file name is custom-script.js and my js code is:
function sendBusinessDetails(postForm) {
$.ajax({//Process the form using $.ajax()
type: 'post', //Method type
url: 'http://localhost:8000/Process', //Your form processing file URL
data: postForm, //Forms name
dataType: 'json',
and my .env file contain
APP_URL=http://localhost:8000
how i can replace APP_URL=http://localhost:8000 into my url: 'http://localhost:8000/Process',
Your help will be highly appreciated
$.ajax({
type: 'post', //Method type
url: '{{env("API_URL")}}/api/apikey?api_key