Skip to content

Instantly share code, notes, and snippets.

import qs from 'qs';
import Axios from 'axios';
Axios.defaults.baseURL = Craft.baseUrl;
Axios.defaults.headers.common['Accept'] = 'application/json';
Axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
Axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
Axios.interceptors.request.use(config => {
if (config.data instanceof FormData) {
@poul-kg
poul-kg / valet.conf
Last active March 1, 2025 19:09
CORS Rules for Laravel Valet Nginx
# To enable CORS you should add lines with CORS rules below to your valet.conf file
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory
# after you edit your valet.conf do not forget to execute `valet restart`
server {
listen 80 default_server;
root /;
charset utf-8;
client_max_body_size 128M;
@johnfmorton
johnfmorton / config.applesilicon.yaml
Last active July 25, 2024 20:51
DDEV config file to add chromium to an Apple Silicon machine. Useful when creating Critical CSS. See: https://nystudio107.com/docs/vite/#using-ddev
webimage_extra_packages:
[
gconf-service,
libasound2,
libatk1.0-0,
libcairo2,
libgconf-2-4,
libgdk-pixbuf2.0-0,
libgtk-3-0,
libnspr4,