https://github.com/rikarani/laravel-vercel
Template buat deploy Laravel ke Vercel
https://github.com/rikarani/laravel-vercel
Last synced: 3 months ago
JSON representation
Template buat deploy Laravel ke Vercel
- Host: GitHub
- URL: https://github.com/rikarani/laravel-vercel
- Owner: rikarani
- Created: 2024-09-09T17:13:25.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-02-20T12:26:00.000Z (5 months ago)
- Last Synced: 2025-03-28T19:21:23.530Z (4 months ago)
- Language: PHP
- Homepage: https://laravel-vercel-erikaaaa.vercel.app
- Size: 341 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ape bende ni?
ini template buat orang yang maok deploy Laravel ke Vercel (atau buat yang penasaran gimane sih care deploy Laravel ke Vercel)
## Notes
Template ini belom ade connect ke database (soalnye Vercel cuma ngasih jatah 1 Postgres doang anying) jadi blom bise CRUD. Jadinya ya untuk sementara palingan buat Static Pages doang.
Sebenernya ada alternatif buat DB sih, misalnya :
1. Neon
2. Supabasentar bakal aku update, tapi tak tau kapan
## Includes
1. Laravel 11
2. TailwindCSS
3. AlpineJS
4. Vite## Step by Step
### 1. clone aja ni repo, kalo mau di-fork pun bole biar namanya bisa seenak jidatmu
```bash
git clone https://github.com/rikarani/laravel-vercel
```### 2. buka Vercel, trus Add New Project

### 3. Import Project

### 4. Deploy Project

### 5. harusnya dapet error, tapi takpa soalnya ada beberapa setting yang mesti diatur

---
## Step by Step Resolve Error
### 1. General
buka `Project Settings > General`, ada beberapa hal yang mesti diubah
- #### Build & Development Settings
ubah Framework Preset jadi `Other`, trus override Output Directory menjadi `public`, kemudian **Save**

- #### Node.js Version
ubah Node.js Version menjadi 18.x, kemudian **Save**

### 2. Setting Environment Variables
buka `Project Settings > Environment Variables` dan tambahkan Environment Variable berikut :
- APP_NAME => `(terserah)`,
- APP_ENV => production,
- APP_KEY => `(ambil dari php artisan key:generate)`,
- APP_DEBUG => false,
- APP_TIMEZONE => `(sesuaikan)`
### 3. Redeploy
buka `Deployments`, trus Redeploy

### 4. Ambil Deployment URL
kalo deploymentnya sukses (gak masalah kalo CSS & JS nya enggak keload), ntar dapet **Deployment URL**, nah copy aja URLnya

### 5. Setting Environment Variables (lagi)
buka lagi `Project Settings > Environment Variables` dan tambahkan Environment Variable berikut :
- APP_URL => `(paste aja Deployment URLnya)`
- ASSET_URL => `(paste aja Deployment URLnya)`
### 6. Redeploy (lagi)
buka lagi `Deployments`, trus Redeploy dari yang terbaru

### 7. Selesai
sampai disini, seharusnya sudah berjalan dengan normal dan preview dari website bisa keliatan

### 8. Happy Coding
---
## For Those Who Ask
- kalo buat API Server gimane tu?
sebagian besar same sih, palingan install sanctum doang
- bise upload file ndak?
ndak bise kalo driver `local`, soalnye tak bise symlink (udah gratis ndak usah banyak minta), jadi mesti cari alternatif laen misalnye S3