Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rverrips's avatar

Anyone tried Laravel as a Google Cloud Function

I know that Laravel Vapor is where the action is, but I have a customer requiring a rather simple, low volume (think perhaps 20 calls a day) Webhook triggered API that updates from one third-party system to another.

For reasons beyond the scope of this discussion, they are locked into the solution running as a google cloud function.

The path most traveled here would be to use an express node.js application which I'm sure will run just fine.

However, I did see that cloud functions can now natively run PHP 7.4 (not sure how long this has been available at the time of writing, August 2021)

Has anyone had any success with Laravel running as a Google Cloud Function (not deployed via Google Cloud App or Cloud Run - That does seem possible, but has all sorts of complexity such as docker make files and/or node.js / php cli runtimes)

I'd imagine a standard Laravel (or maybe Laravel Lumen) build would work fine as a Google Cloud Function, but just can't seem to find anyone who has done this (or tried and failed)

0 likes
1 reply
rverrips's avatar
rverrips
OP
Best Answer
Level 5

This wasn't all that hard to do actually and Google Cloud Functions PHP runs Laravel pretty seamlessly.

Did need some basic default config like setting storage folder to /tmp, etc.

I wrote a small package that sets the needed config based on learnings from Bref.

(Open for update/corrections with ideas such as mapping to google storage, etc.)

https://github.com/rverrips/laravel-google-cloud-function-config

6 likes

Please or to participate in this conversation.