Skip to content

Instantly share code, notes, and snippets.

@albasyir
Last active April 29, 2021 09:53
Show Gist options
  • Save albasyir/a068dc5ad5c86e5e0fac3b0a2adb5d76 to your computer and use it in GitHub Desktop.
Save albasyir/a068dc5ad5c86e5e0fac3b0a2adb5d76 to your computer and use it in GitHub Desktop.
Vercel Config for Laravel, make your laravel hosted free!
node_modules
vendor

Vercel Config for Laravel

just copy vercel.json, .vercelignore to root project directory, create api folder to root project directory and latest copy index.php to api folder, all set automaticly!

<?php
// Plate it to /api/index.php
// Forward Vercel requests to normal index.php
require __DIR__ . '/../public/index.php';
{
"version": 2,
"functions": {
"api/index.php": { "runtime": "vercel-php@0.3.1" }
},
"routes": [
{
"src": "/(.*)",
"dest": "/api/index.php"
}
],
"env": {
"APP_ENV": "production",
"APP_DEBUG": "true",
"APP_URL": "https://yourproductionurl.com",
"APP_CONFIG_CACHE": "/tmp/config.php",
"APP_EVENTS_CACHE": "/tmp/events.php",
"APP_PACKAGES_CACHE": "/tmp/packages.php",
"APP_ROUTES_CACHE": "/tmp/routes.php",
"APP_SERVICES_CACHE": "/tmp/services.php",
"VIEW_COMPILED_PATH": "/tmp",
"CACHE_DRIVER": "array",
"LOG_CHANNEL": "stderr",
"SESSION_DRIVER": "cookie"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment