export default async function laravelHelper(event: any, url: string, method: string = 'GET', body: any = null) {
  const config = useRuntimeConfig()

  let options: any = {}
  if(body) {
    options = {
      ...options,
      body: body
    }
  }
  
  return await $fetch(config.api.laravel+'/api/'+url, {
    method: method,
    headers: {
      Accept: 'application/json',
      'Content-Type': 'application/json',
    },
    ...options
  })
}