Majority of updates taken from pull request by @cmizzi
This repository inherits from Laravel 10.x. Important files are the following ones:
Add the following snippet in the composer.json
file.
{
"scripts": {
"vercel": [
"npm install",
"npm run build"
]
}
}
See app/Http/Middleware/TrustProxies.php
.
- protected $proxies = null;
+ protected $proxies = "*";
You still need to setup the basics, such as making an .env
file, setting an APP_KEY
, etc.
Do not save your APP_KEY
in the .vercel.json
file. You must set this in the settings.
cp .env.example .env
If you do not want to change the build output folder settings, run this:
mkdir dist
echo "# for vercel output" >> dist/.gitkeep
There is a chance that your local .dotfiles
have the dist
folder in a .gitignore
file, so force add it:
git add dist -f
git commit -m "chore: dist folder for vercel output"
git push