kib-ev / laravel-ftp-deploy
Deploy Laravel project files to shared hosting via FTP (Artisan command)
Requires
- php: ^8.1
- ext-ftp: *
- illuminate/console: ^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^10.0|^11.0|^12.0|^13.0
- vlucas/phpdotenv: ^5.6
README
Artisan command php artisan deploy for uploading project files to shared hosting via FTP.
Local development only: the command runs when APP_ENV=local. Credentials are stored in .ftp-deploy (not committed to git).
Repository: github.com/kib-ev/laravel-ftp-deploy
Requirements
- PHP 8.1+
- ext-ftp
Installation
composer require --dev kib-ev/laravel-ftp-deploy
On production with composer install --no-dev, the package is not installed.
Configuration
Copy the example file to your Laravel project root:
cp vendor/kib-ev/laravel-ftp-deploy/.ftp-deploy.example .ftp-deploy
.ftp-deploy:
host=ftp.example.com username=user password=secret port=21 root=/sites/example.com ssl=false passive=true
Add to your project .gitignore:
.ftp-deploy
Usage
php artisan deploy --file=public/index.php php artisan deploy --file=.env.production:.env php artisan deploy --dir=app/Http/Controllers
AI-assisted workflow (Cursor, etc.)
This package works well with AI-powered editors such as Cursor. After you change code locally, ask the agent to deploy only the modified files — no separate deployment pipeline required.
Example prompts:
- "Deploy the changed files to production via FTP"
- "Run
php artisan deployforroutes/web.phpandapp/Http/Controllers/OrderController.php" - "Upload
.env.productionas.envon the server"
The agent can run php artisan deploy --file=... for individual paths or --dir=... for whole directories. Credentials stay in your local .ftp-deploy file and are never committed to git.
Local development (path repository)
{
"repositories": [
{
"type": "path",
"url": "../laravel-ftp-deploy"
}
],
"require-dev": {
"kib-ev/laravel-ftp-deploy": "*"
}
}
License
MIT