kristiansnts/vercel-laravel

Generate Vercel deployment files for Laravel applications

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/kristiansnts/vercel-laravel

v1.0.0 2025-11-24 01:36 UTC

This package is not auto-updated.

Last update: 2025-12-23 00:07:31 UTC


README

A simple Composer package to generate Vercel deployment files for Laravel applications.

Inspired by Caleb Porzio's article on deploying Laravel to Vercel.

Installation

Add the package to your Laravel project:

composer require kristiansnts/vercel-laravel

Or install it as a local package by adding this to your main composer.json:

"repositories": [
    {
        "type": "path",
        "url": "./packages/vercel-laravel"
    }
]

Then run:

composer require kristiansnts/vercel-laravel

Usage

Run the setup command to generate all required Vercel files:

php artisan vercel:setup

This will create:

  • api/index.php - Entry point for Vercel serverless functions
  • .vercelignore - Files to ignore during deployment
  • vercel.json - Vercel deployment configuration

Files Generated

api/index.php

Forwards Vercel requests to your Laravel application's public/index.php.

.vercelignore

Excludes the vendor directory from deployment (Vercel will install dependencies).

vercel.json

Contains the complete Vercel configuration including:

  • Build settings for PHP and static assets
  • Routing rules for assets and API endpoints
  • Environment variables for production deployment

After Generation

  1. Review and update the APP_URL in vercel.json with your production URL
  2. Add any additional environment variables to vercel.json as needed
  3. Deploy to Vercel using the Vercel CLI or GitHub integration

License

MIT