Deploy a Laravel or PHP site with AI in one pass

What BrewInTH handles for Laravel, how to set APP_KEY, DB_* and migrations, and a prompt that gets your AI to deploy Laravel or PHP in one pass.
Laravel is a PHP framework AI writes fluently: ask for member accounts, an admin panel or a small shop and you get it fast. Going live is where things tend to stall: a missing APP_KEY, a database that won't connect, migrations nobody ran, a 500 error on the home page, uploads that fail.
This article sums up what BrewInTH already handles for Laravel and PHP, what you still need to tell your AI, and a prompt you can use right away, so the first deploy goes through in one pass.
In short
✅ Choose Laravel (PHP), or Let the platform decide: it spotscomposer.jsonby itself.
✅ Don't uploadvendor/or.env. Composer runs during the build; secrets go in App settings.
✅ Set the release command tophp artisan migrate --forceso migrations run before the new version goes live.
✅ On Laravel 11 and later, the platform checks readiness at/upfor you.
✅ Upload size follows your package: 20 MB on Free, 100 MB on paid packages.
What BrewInTH does for Laravel automatically

- Detects the technology from your code. With Let the platform decide (recommended),
composer.jsonmarks the project as PHP/Laravel, locked from the first release on. - Installs packages at build time. The AI sends
composer.jsonandcomposer.lock; thevendor/folder stays home. - Serves from
public/, so the rest of the project is never exposed. - Checks readiness at
/upon Laravel 11+ (the route Laravel ships with). Visitors see a new version only once it answers. - Keeps
storage/andbootstrap/cachewritable, for the site and for artisan commands alike. - Sets php.ini by package: uploads up to 20 MB per request on Free and 100 MB on paid packages (PHP's own default is 2 MB).
- Adds the database connection. Once the database is ready,
DATABASE_URL(PostgreSQL) orMYSQL_URL(MySQL/MariaDB) appears in App settings.
What to spell out for your AI
An AI reading BrewInTH's guide already knows these steps, but naming them in your prompt keeps it from slipping.

1. Laravel's settings
Laravel reads .env, but that file should never be uploaded to a live site. Have the AI put these in the project's App settings instead:
APP_KEYasbase64:…, created once and kept. Never regenerate it, or sessions and encrypted data break.APP_ENV=productionandAPP_DEBUG=false, so error pages don't reveal internals to visitors.APP_URLset to the real site address.LOG_CHANNEL=stderr, so Laravel's logs show up in the project's Logs.- The database names Laravel reads:
DB_CONNECTION,DB_HOST,DB_PORT,DB_DATABASE,DB_USERNAME,DB_PASSWORD. The AI takes them from the project database's connection details. SESSION_DRIVERandCACHE_STOREcan bedatabaseorfile; if the project has Redis,redisworks too.
2. Migrate with the release command
BrewInTH has a Release command (runs before the release goes live) field under Advanced options (build / start / port) on the publish page, and the AI can also set it while deploying. Set it to:
php artisan migrate --force
It runs from the new version before visitors are switched over. If the migration fails, that release fails and the current version keeps serving. The command's output sits in that release's log, on lines starting with [release command].
3. Files your users upload
Files an app writes to disk are normally lost on the next release. If users upload pictures or documents, turn on Persistent storage (/data) and have Laravel store them under /data. That space counts toward your package's storage. With persistent storage on, each new release has a brief pause while the old one releases the disk.
4. Queues and scheduled jobs
If the app uses queues, for example to send email in the background, add a Scheduled jobs (cron) entry running php artisan queue:work --stop-when-empty every few minutes (the shortest interval is 5 minutes). Other artisan commands you run regularly can be separate scheduled jobs, up to 10 per project.
A prompt for a one-pass Laravel deploy
Open the AI on your computer in the Laravel project folder, paste BrewInTH's ready-made message, then add:
(paste the ready-made message from BrewInTH here)
This is a Laravel project. Deploy it to BrewInTH in one pass, following the Laravel section of the guide.
- The ZIP leaves out vendor/, .env and .git
- Set all App settings at once: APP_KEY (reuse the existing one if there is one), APP_ENV=production,
APP_DEBUG=false, APP_URL, LOG_CHANNEL=stderr and DB_* from the project's database
- Set the release command to php artisan migrate --force
- If the app accepts uploads, turn on persistent storage and keep the files under /data
- After deploying, open the live site, check the home page and the login page, and give me the link
If it fails, read the release log, fix the problem and try again until it works
No code yet? Ask the AI to create a new Laravel project locally and get its tests passing first, then use the prompt above. For choosing between PostgreSQL and MySQL, see the database guide.
Plain PHP without Laravel
Choose PHP (or let the platform decide) for sites written in plain PHP or another framework:
- If there is a
composer.json, packages are installed at build time, just like Laravel. - For a site whose home page can't answer quickly (an API, say), set the Health check path under Advanced options to a route that returns 200, such as
/health. - Read the database connection from
DATABASE_URLorMYSQL_URLin the environment; never write passwords into PHP files. - Upload limits follow the package here too (20 MB Free, 100 MB paid).
Deploy failed? Where to look
Open the project and look at the release history: the newest failed release opens its log by itself. Look for these lines, or simply copy the log to your AI:
[release command]: the output ofmigrate, such as a table that already exists or a failed connection because aDB_*value is wrong.[readiness]: the readiness check, such as/upanswering 500, usually an emptyAPP_KEYor an unwritablestorage.- Build errors, such as
composer installfailing becausecomposer.lockdoesn't matchcomposer.json.
Watch the video (in Thai)
▶ From creating a project to opening the site (1:30)
Watch on YouTube
Frequently asked questions
Do I upload the vendor folder?
No, and you shouldn't. Composer installs it during the build from composer.lock. Assets published into public/vendor/ (Livewire's, for example) do get uploaded as usual.
MySQL or PostgreSQL for Laravel?
Both work. If the project is already set up for mysql, MySQL or MariaDB is the easiest path; for a fresh start, PostgreSQL works well.
How do I know which PHP version runs my site?
After each build, the platform records the PHP version, the loaded extensions and the Laravel version with that release. Ask your AI to read them from the project details.
Can users upload files larger than 100 MB?
Not in one request: 100 MB is the most on paid packages. For bigger files, have the app upload in chunks.
How do I publish changes later?
Keep chatting in the same chat and ask for a new deploy; the release command migrates every time. If the token has expired, create a new link and token on the project page.
Summary
Laravel on BrewInTH needs no server setup: packages, the /up check, php.ini and the database connection are handled for you. What your AI must get right is App settings, the migrate --force release command and persistent storage for uploads. Use the prompt above and your Laravel site can go live in one pass.
Start your first project free →
