tilabs/laravel-deploy

Deploy and optimize your Laravel applications with a single command, even on VPS based hostings.

v1.0.0 2025-05-18 20:12 UTC

This package is auto-updated.

Last update: 2025-05-18 20:56:43 UTC


README

⚡️ Deploy and optimize your Laravel apps with one command. This also works on chrooted VPS hostings.

License: MIT

Why this package

On Plesk servers with chroot-restricted SSH, php artisan optimize misfires because the chroot skews Laravel’s base path. Executing the same routine through a secured HTTP endpoint preserves the correct context, enabling reliable optimization without direct shell access.

Requirements

Version
PHP ^8.2
Laravel 12.x

Installation

composer require tilabs/laravel-deploy

Publish & set your secret deployment key

php artisan vendor:publish --provider="Tilabs\LaravelDeploy\Providers\DeploymentServiceProvider"

This will create a config/deployment.phpconfiguration file in your project, which you can modify to your needs using environment variables.

To change the default deployment key - which you absolutely should - set an environment Variable in your .env file.

DEPLOYMENT_KEY=...

Usage

Optimize Laravel

This command will now work on Plesk VPS Hostings. If the optimization process is successful, you receive the info message Application optimized successfully. If you are lazy, you can run this command automatically after your repository has been pulled by Plesk.

php artisan site:optimize

Link Public Storage

To link the storage public folder, usually done by running php artisan storage:link, you can now use the command below. If everything worked out correctly, you receive the info message Application storage linked successfully.

php artisan site:storage-link

Common Pitfalls

As we are working with caches, it is never a bad idea to just remove the previous cached versions. This can easily be done using the laravel default command to clear the cache.

php artisan optimize:clear

License

Laravel Deploy is open‑sourced software licensed under the MIT license.