iTranslated by AI
How to Deploy Laravel to Laravel Cloud
Introduction
Deployment Steps
When I tried to deploy an application using Laravel Cloud, I couldn't find any detailed Japanese articles summarizing the procedure other than the official documentation.
Therefore, I decided to put together the deployment procedure using Laravel Cloud, partly as a memo for myself.
This article explains the flow from project creation to configuring the database and Queue Workers, registering environment variables, and the final deployment.
I have tried to make it easy to follow even for those using Laravel Cloud for the first time, so I hope you find it helpful.
1. Project Settings
First, please click New application from the Home (Overview).

Next,
- Select the repository you want to deploy from Repository
- Enter the Application name (the repository name should be automatically entered once you select the repository)
- Select the Region (any region should be fine, but here we select
Asia Pacific)
Once you have entered the information, click the New application button.

2. Adding a Database
Once the project setup is complete, you should see a screen like the following.
Please add a database from Add database on the right side of the screen.
Note: At the time of writing this article, PostgreSQL was the only database available to select.

After selecting it, the Save button should appear at the bottom of the screen, so please save it.

3. Queue Worker Settings (If needed)
If you want to perform job queue processing, add the Queue Worker settings.
First, click the Add worker cluster button.

Several configuration items will be displayed, but basically, there is no problem leaving them at their defaults.
Scroll down to the bottom of the page and add a new background process from the New background process section.

These input items are also fine with the default settings if there are no specific changes.
Once the settings are complete, click the Create background process button to finish the creation.

A Save button should appear at the bottom of the screen, so please save it.

4. Environment Variable Settings
Open Settings → General from the menu bar and set environment variables from Custom environment variables at the bottom of the page.
Set the environment variables necessary for your environment.

Additionally, in the injected variables section below Custom environment variables, there are environment variables that are automatically inserted. These cannot be edited, but it seems they can be overwritten (e.g., they include database connection information).

5. Deployment
Once you have completed the settings up to this point, deploy the app.
Click the deploy button at the top right of the screen.

Deployment takes a little time. Please wait for a while.

Once the deployment is finished, the app's domain will be displayed in the Domains section at the bottom left of the screen. You can check if the app is actually working correctly from that link.

Conclusion
In this article, I explained the procedure for deploying an application using Laravel Cloud.
Since it is a service that has just been released, there were some parts where I had to find my way through trial and error due to the limited information available, but I hope this article is of some help to someone.
Discussion