Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [Caching Events](#caching-events)
- [Caching Routes](#optimizing-route-loading)
- [Caching Views](#optimizing-view-loading)
- [Reloading Services](#reloading-services)
- [Debug Mode](#debug-mode)
- [The Health Route](#the-health-route)
- [Deploying With Laravel Cloud or Forge](#deploying-with-cloud-or-forge)
Expand Down Expand Up @@ -168,6 +169,20 @@ php artisan view:cache

This command precompiles all your Blade views so they are not compiled on demand, improving the performance of each request that returns a view.

<a name="reloading-services"></a>
## Reloading Services

> [!NOTE]
> When deploying to [Laravel Cloud](https://cloud.laravel.com), it is not necessary to use the `reload` command, as gracefully reloading of all services is handled automatically.

After deploying a new version of your application, any long-running services such as queue workers, Laravel Reverb, or Laravel Octane should be reloaded / restarted to use the new code. Laravel provides a single `reload` Artisan command that will terminate these services:

```shell
php artisan reload
```

If you are not using [Laravel Cloud](https://cloud.laravel.com), you should manually configure a process monitor that can detect when your reloadable processes exit and automatically restart them.

<a name="debug-mode"></a>
## Debug Mode

Expand Down
18 changes: 18 additions & 0 deletions packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- ["About" Artisan Command](#about-artisan-command)
- [Commands](#commands)
- [Optimize Commands](#optimize-commands)
- [Reload Commands](#reload-commands)
- [Public Assets](#public-assets)
- [Publishing File Groups](#publishing-file-groups)

Expand Down Expand Up @@ -390,6 +391,23 @@ public function boot(): void
}
```

<a name="reload-commands"></a>
### Reload Commands

Laravel's [reload command](/docs/{{version}}/deployment#reloading-services) terminates any running services so they can be automatically restarted by a system process monitor. Using the `reloads` method, you may register your package's own Artisan commands that should be invoked when the `reload` command is executed:

```php
/**
* Bootstrap any package services.
*/
public function boot(): void
{
if ($this->app->runningInConsole()) {
$this->reloads('package:reload');
}
}
```

<a name="public-assets"></a>
## Public Assets

Expand Down