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

michaelnguyen547's avatar

How do I setup Laravel project locally with the intent to use Laravel Vapor?

I try to match the local environment with the production environment as close as possible. I usually use Homestead for the development environment.

When watching Taylor's Vapor video about AWS SES, DynamoDB, Queue, how do I set up so that Homestead development environment will use AWS SES, DynamoDB, Queue automatically as Vapor.

Do I need to set up a development environment on Vapor instead of Homestead? The issue with this is I have to constantly commit and deploy to view the changes.

If I work on Homestead locally, I am worried that things will not work when deploying to Vapor because Vapor is different from Homestead

0 likes
5 replies
fylzero's avatar

@michaelnguyen547 Vapor automatically sets up a development url for you.

Here's a helpful walk thru...

https://youtu.be/xqVUdebctAM

Also, you won't be able to match locally what Lambda is doing. I believe it configures PHP to run in layers... not sure how all that works under the hood, but matching the PHP version and MySQL version locally should be sufficient. Vapor will provision servers properly and is well documented where things need to be adjusted, like running Redis, etc.

24 likes
michaelnguyen547's avatar

@fylzero you are referring to staging environment.

In the video you shared, the uploading file is quite annoying that it does not work locally, but only on vapor. How do you debug these kinds of issues?

Making guess works, commit and deploying to Vapor to verify? I want to avoid these situations.

fylzero's avatar

@michaelnguyen547 Well yeah, I mean Staging is typically where you will test code before deploying to production.

You shouldn't really be uploading asset files to a web server in the first place. It's a bad practice. S3 storage gives the ability to provide redundant backup for things that are client files. Also it essentially acts as a CDN of sorts to not make file downloads reliant on the web server which will need that extra bandwidth at scale.

If you want to avoid these issues... just use a regular server and don't use Vapor. Problem solved.

24 likes
michaelnguyen547's avatar

@fylzero got it. Uploading file as in uploading profile picture and documents (not the asset files).

But you are correct. There are a lot of questions I have about Vapor

  • Uploading files is difficult to debug
  • How about uploading files from mobile apps?
  • Fixed-size database is only 1 instance, there is no redundancy (people can say pick serverless)
  • What to do if one of your services down? Queue down? SES down? Scheduler down? Who do you talk to?
  • How to debug?
fylzero's avatar

@michaelnguyen547 It is common nomenclature to refer to both internal assets and client assets as "assets". Client assets specifically should always exist off-server, preferably on S3 regardless if you use Vapor or whatever.

Uploading files isn't really difficult to debug. It's really straight forward if image uploads fail.

Services fail on regular servers as well... typically you will program ways of handling service failures... log failed items to a future job table, write a heartbeat function to detect when services come back online, then re-execute failed jobs.

Sure, fixed or dynamic sized database are options. You can always scale up a fixed database.

You can send yourself notifications if services fail and restart or worse case re-provision your environment very easily. Takes about 10 minutes.

How to debug? Just because you are deploying to Vapor doesn't mean you can't develop your app locally using Homestead or Valet. Just do that. Deploy to staging to test in mirrored server environment... deploy live once you've tested.

24 likes

Please or to participate in this conversation.