Back to Deployer

How to Deploy a Laravel Project

docs/recipe/laravel.md

8.0.314.9 KB
Original Source
<!-- DO NOT EDIT THIS FILE! --> <!-- Instead edit recipe/laravel.php --> <!-- Then run bin/docgen -->

How to Deploy a Laravel Project

php
require 'recipe/laravel.php';

Source

Deployer is a free and open source deployment tool written in PHP. It helps you to deploy your Laravel application to a server. It is very easy to use and has a lot of features.

Three main features of Deployer are:

  • Provisioning - provision your server for you.
  • Zero downtime deployment - deploy your application without a downtime.
  • Rollbacks - rollback your application to a previous version, if something goes wrong.

Additionally, Deployer has a lot of other features, like:

  • Easy to use - Deployer is very easy to use. It has a simple and intuitive syntax.
  • Fast - Deployer is very fast. It uses parallel connections to deploy your application.
  • Secure - Deployer uses SSH to connect to your server.
  • Supports all major PHP frameworks - Deployer supports all major PHP frameworks.

You can read more about Deployer in Getting Started.

The deploy task of Laravel consists of:

The laravel recipe is based on the common recipe.

Configuration

shared_dirs

Source

Overrides shared_dirs from recipe/deploy/shared.php.

php
['storage']

shared_files

Source

Overrides shared_files from recipe/deploy/shared.php.

php
['.env']

writable_dirs

Source

Overrides writable_dirs from recipe/deploy/writable.php.

php
[
    'bootstrap/cache',
    'storage',
]

writable_recursive

Source

Overrides writable_recursive from recipe/deploy/writable.php.

php
true

log_files

Source

php
'storage/logs/*.log'

bin/artisan

Source

php
'{{release_or_current_path}}/artisan'

laravel_version

Source

php
$result = run("{{bin/php}} {{bin/artisan}} --version");
preg_match_all('/(\d+\.?)+/', $result, $matches);
return $matches[0][0] ?? 5.5;

public_path

Source

Overrides public_path from recipe/provision/website.php.

php
'public'

Tasks

artisan:down {#artisan-down}

Source

Puts the application into maintenance / demo mode.

Maintenance mode.

artisan:up {#artisan-up}

Source

Brings the application out of maintenance mode.

artisan:key:generate {#artisan-key-generate}

Source

Sets the application key.

Generate keys.

artisan:passport:keys {#artisan-passport-keys}

Source

Creates the encryption keys for API authentication.

artisan:db:seed {#artisan-db-seed}

Source

Seeds the database with records.

Database and migrations.

artisan:migrate {#artisan-migrate}

Source

Runs the database migrations.

artisan:migrate:fresh {#artisan-migrate-fresh}

Source

Drops all tables and re-run all migrations.

artisan:migrate:rollback {#artisan-migrate-rollback}

Source

Rollbacks the last database migration.

artisan:migrate:status {#artisan-migrate-status}

Source

Shows the status of each migration.

artisan:cache:clear {#artisan-cache-clear}

Source

Flushes the application cache.

Cache and optimizations.

artisan:config:cache {#artisan-config-cache}

Source

Creates a cache file for faster configuration loading.

artisan:config:clear {#artisan-config-clear}

Source

Removes the configuration cache file.

artisan:event:cache {#artisan-event-cache}

Source

Discovers and cache the application's events and listeners.

artisan:event:clear {#artisan-event-clear}

Source

Clears all cached events and listeners.

artisan:event:list {#artisan-event-list}

Source

Lists the application's events and listeners.

artisan:optimize {#artisan-optimize}

Source

Cache the framework bootstrap files.

artisan:optimize:clear {#artisan-optimize-clear}

Source

Removes the cached bootstrap files.

artisan:reload {#artisan-reload}

Source

Reload running services.

artisan:route:cache {#artisan-route-cache}

Source

Creates a route cache file for faster route registration.

artisan:route:clear {#artisan-route-clear}

Source

Removes the route cache file.

artisan:route:list {#artisan-route-list}

Source

Lists all registered routes.

Source

Creates the symbolic links configured for the application.

artisan:view:cache {#artisan-view-cache}

Source

Compiles all of the application's Blade templates.

artisan:view:clear {#artisan-view-clear}

Source

Clears all compiled view files.

artisan:queue:failed {#artisan-queue-failed}

Source

Lists all of the failed queue jobs.

Queue and Horizon.

artisan:queue:flush {#artisan-queue-flush}

Source

Flushes all of the failed queue jobs.

artisan:queue:restart {#artisan-queue-restart}

Source

Restarts queue worker daemons after their current job.

artisan:horizon {#artisan-horizon}

Source

Starts a master supervisor in the foreground.

artisan:horizon:clear {#artisan-horizon-clear}

Source

Deletes all of the jobs from the specified queue.

artisan:horizon:continue {#artisan-horizon-continue}

Source

Instructs the master supervisor to continue processing jobs.

artisan:horizon:list {#artisan-horizon-list}

Source

Lists all of the deployed machines.

artisan:horizon:pause {#artisan-horizon-pause}

Source

Pauses the master supervisor.

artisan:horizon:purge {#artisan-horizon-purge}

Source

Terminates any rogue Horizon processes.

artisan:horizon:status {#artisan-horizon-status}

Source

Gets the current status of Horizon.

artisan:horizon:terminate {#artisan-horizon-terminate}

Source

Terminates the master supervisor so it can be restarted.

artisan:horizon:publish {#artisan-horizon-publish}

Source

Publish all of the Horizon resources.

artisan:horizon:supervisors {#artisan-horizon-supervisors}

Source

Lists all of the supervisors.

artisan:horizon:clear-metrics {#artisan-horizon-clear-metrics}

Source

Deletes metrics for all jobs and queues.

artisan:horizon:snapshot {#artisan-horizon-snapshot}

Source

Stores a snapshot of the queue metrics.

artisan:schedule:interrupt {#artisan-schedule-interrupt}

Source

Interrupt in-progress schedule:run invocations.

Scheduler.

artisan:telescope:clear {#artisan-telescope-clear}

Source

Clears all entries from Telescope.

Telescope.

artisan:telescope:prune {#artisan-telescope-prune}

Source

Prunes stale entries from the Telescope database.

artisan:octane {#artisan-octane}

Source

Starts the octane server.

Octane.

artisan:octane:reload {#artisan-octane-reload}

Source

Reloads the octane server.

artisan:octane:stop {#artisan-octane-stop}

Source

Stops the octane server.

artisan:octane:status {#artisan-octane-status}

Source

Check the status of the octane server.

artisan:nova:publish {#artisan-nova-publish}

Source

Publish all of the Laravel Nova resources.

Nova.

artisan:reverb:start {#artisan-reverb-start}

Source

Starts the Reverb server.

Reverb.

artisan:reverb:restart {#artisan-reverb-restart}

Source

Restarts the Reverb server.

artisan:pulse:check {#artisan-pulse-check}

Source

Starts the Pulse server.

Pulse.

artisan:pulse:restart {#artisan-pulse-restart}

Source

Restarts the Pulse server.

artisan:pulse:purge {#artisan-pulse-purge}

Source

Purges all Pulse data from storage.

artisan:pulse:work {#artisan-pulse-work}

Source

Process incoming Pulse data from the ingest stream.

deploy {#deploy}

Source

Deploys your project.

Main deploy task.

This task is group task which contains next tasks: