Sites

Laravel

A Laravel site on Cove is a normal Laravel project in ~/Cove/Sites/<name>.localhost/, served at its own https address. Cove makes a new app, or sets up one you already have, and keeps its workers running.

A new app#

cove add myapp laravel

Cove creates the app the way laravel new does, then sets up .env for this machine:

  • APP_URL is https://myapp.localhost.
  • Mail goes to Cove's mailbox, from hello@myapp.localhost. See Mail.
  • An app key is generated and the migrations run.
  • REDIS_PREFIX is set to the site's own, in case the app uses Redis later.
Cove prints
✅ Laravel 13.37.0 Installed
URL: https://myapp.localhost
Folder: /Users/you/Cove/Sites/myapp.localhost
Database: SQLite, database/database.sqlite
Mail lands in Cove's mailbox: https://mail.cove.localhost
Artisan: cove artisan myapp <command>
Queued jobs run once a worker is going: cove laravel myapp queue on

The site's folder is the project. Its public/ folder is what's served. --seed runs the seeders after the migrations, which in a new app adds one user, test@example.com.

Picking a database#

SQLite is the default, as it is with laravel new. --database picks another:

cove add myapp laravel                     # SQLite, in database/database.sqlite
cove add myapp laravel --database=mysql    # a database on Cove's MariaDB
cove add myapp laravel --database=pgsql    # a database on PostgreSQL

mariadb works the same as mysql. A MariaDB or PostgreSQL database is named cove_myapp, and its credentials go into .env. PostgreSQL is set up the first time an app asks for it. See Databases.

An app you already have#

--from takes a git repository's address, a folder or an archive:

cove add shop --from=git@github.com:you/shop.git
cove add shop --from=https://github.com/you/shop.git --branch=develop
cove add shop --from=~/Herd/shop --seed
cove add shop --from=https://example.com/releases/shop.zip

A repository is cloned. A folder is copied, without its vendor/ and node_modules/, and the original is left as it is. An archive, a .zip, .tar.gz, .tgz or .tar file or https:// link, is unpacked. An app that isn't Laravel is then served from its public/ (see Plain PHP). For a Laravel project, Cove:

  • installs the Composer packages,
  • writes .env for Cove, from .env.example when there isn't one: the https address, mail to Cove's mailbox, and the database,
  • makes the database the project names (or the one --database gives) and runs the migrations, and the seeders with --seed,
  • links public/storage,
  • installs the JavaScript packages and builds the front end, with npm, pnpm, yarn or bun, whichever the lock file belongs to. This needs Node.js. Without it Cove says so and the rest still happens.
FlagWhat it does
--from=<src>A git URL (https://…, git@host:path), a folder, or an archive (.zip, .tar.gz, .tgz or .tar: a file or an https:// link).
--branch=<b>With a git URL, the branch or tag to check out.
--database=<db>sqlite, mysql, mariadb or pgsql, in place of the one the project names.
--seedRun the seeders after the migrations.
--php=<ver>Pin an older PHP (macOS). See PHP.

A copied app on MariaDB or PostgreSQL starts with an empty database: the migrations make the tables, and none of the original's rows come along. What the tools printed is in the site's logs/laravel-setup.log.

On macOS, Documents, Desktop and Downloads are private to the apps you allow. If your project is in one of them, run cove add from Terminal rather than the dashboard.

Artisan and Composer#

Both run from any folder, on the PHP the site serves with:

cove artisan myapp migrate
cove artisan myapp make:model Post -m
cove composer myapp require laravel/sanctum

A --help after the site name is artisan's or Composer's own. Cove keeps its own copy of Composer, so you don't need one installed.

Queue and scheduler#

Queued jobs and scheduled tasks need something running in the background. Cove keeps it running for you:

cove laravel myapp queue on       # artisan queue:listen
cove laravel myapp schedule on    # artisan schedule:work
cove laravel myapp                # which workers are running
cove laravel myapp queue off
Cove prints
Laravel 13.37.0 · myapp.localhost
  queue     running (pid 48213)
  schedule  running (pid 48251)

A worker that is on stays on: the watchdog starts it again after a crash or a reboot. The queue worker reloads your code for each job, so changes take effect without a restart. Each worker writes to logs/laravel-<worker>.log in the site folder. Add --format=json for scripts.

Reverb#

One command adds Reverb to an app, with Echo in its front end, and turns it on:

cove laravel myapp reverb install
Cove prints
   - Adding Reverb (composer require laravel/reverb, the broadcasting config, routes/channels.php)…
   - Adding Echo to the front end (npm install laravel-echo pusher-js)…
   - Building the front end with Reverb's settings…
📡 Reverb: wss://myapp.localhost (port 8080 on this machine).

Reverb listens on a port of its own, and browsers reach it at wss://myapp.localhost, through the same HTTPS as the site. Cove writes both sides into .env. For an app that already has Reverb, cove laravel myapp reverb on and off start and stop it.

Users and logging in#

cove laravel myapp users                              # list them
cove laravel myapp user add you@example.com --name="You"
cove login myapp                                      # a link, as the first user
cove login myapp you@example.com --to=/admin

user add creates a verified user with a made-up password, printed once, unless you give one with --password. cove login prints a link that signs you in through the app's own auth, as the user you name (an id or email) or the first one. It lands on --to, the app's dashboard route, or the home page. The link works once, within five minutes, and only on this computer.

Redis#

When an app set up with --from keeps its cache, sessions or queue in Redis, Cove sets Redis up and points the app at it. For a new app, run cove redis install, then set CACHE_STORE, SESSION_DRIVER or QUEUE_CONNECTION to redis in .env. Each site's keys carry its own prefix, cove:myapp:, so apps never see each other's keys.

The front end#

Run Vite as you normally would, in the site's folder:

cd ~/Cove/Sites/myapp.localhost
npm install
npm run dev

The page at https://myapp.localhost picks up the dev server while it runs. npm run build makes the files it serves without one.

Logs and the dashboard#

cove log myapp shows the newest file in storage/logs/, then the access log. Add -f to follow it. The site's page in the dashboard has tabs for its users, routes, migrations, schedule and an artisan console, with a switch for each worker.

Clone, rename, backups and snapshots all work on Laravel sites, database included. See Managing sites and Backups and moving.

Something wrong or missing here? Open an issue ↗ Every command also explains itself: cove help <command>.