CLI Commands.
Artisan commands for installing, updating, and maintaining InvoiceScript.
CLI Commands
For: developers and system administrators managing InvoiceScript from the command line.
InvoiceScript does not require CLI access for daily use. The web installer handles setup. These commands are for developers, hosting administrators, and troubleshooting.
Installation and setup
| Command | Description |
|---|---|
php artisan migrate |
Run database migrations |
php artisan db:seed |
Seed default roles, permissions, and email templates |
php artisan db:seed --class=DemoSeeder |
Seed demo data (customers, items, invoices, quotes) |
Cache management
| Command | Description |
|---|---|
php artisan config:cache |
Cache configuration (recommended for production) |
php artisan config:clear |
Clear configuration cache |
php artisan route:cache |
Cache routes (recommended for production) |
php artisan route:clear |
Clear route cache |
php artisan view:cache |
Cache compiled Blade views |
php artisan view:clear |
Clear compiled Blade views |
php artisan cache:clear |
Clear application cache |
Maintenance
| Command | Description |
|---|---|
php artisan down |
Put the application in maintenance mode |
php artisan up |
Bring the application back online |
php artisan storage:link |
Create the public storage symlink |
Automation
These commands run automatically when a cron job is configured. You can also run them manually.
| Command | Description | Schedule |
|---|---|---|
php artisan recurring:generate |
Generate invoices for all active recurring schedules that are due | Daily at 06:00 |
php artisan reminders:send |
Send scheduled payment reminders for overdue and upcoming-due invoices | Daily at 07:00 |
php artisan backup:create |
Create a database and media backup | Daily or weekly (configurable in Settings) |
php artisan backup:clean |
Remove backups exceeding the retention limit | After each backup |
Recurring invoice generation runs first (06:00), then reminders (07:00), so newly generated invoices are available before reminders are evaluated.
Each recurring:generate run produces at most one invoice per schedule. If the server missed multiple days, subsequent runs catch up one invoice at a time.
Backups
Create a backup
php artisan backup:create
Creates a full backup of the database and media files. The backup is stored in storage/backups/ as a ZIP file. After creating the backup, the retention policy is applied automatically.
Options:
| Option | Description |
|---|---|
--passphrase=SECRET |
Encrypt the backup with a passphrase using AES-256 encryption. You need this passphrase to restore. |
Example:
# Create an encrypted backup
php artisan backup:create --passphrase="my-secret-phrase"
Clean old backups
php artisan backup:clean
Removes backups that exceed the retention limit. The retention count is read from Settings > Backups (default: 5). Only the N most recent backups are kept.
Options:
| Option | Description |
|---|---|
--keep=N |
Override the retention count from settings. |
Example:
# Keep only the 3 most recent backups
php artisan backup:clean --keep=3
Cron setup
InvoiceScript uses Laravel's task scheduler. Add this cron entry to your server:
* * * * * cd /path-to-invoicescript && php artisan schedule:run >> /dev/null 2>&1
Replace /path-to-invoicescript with the absolute path to your InvoiceScript installation.
cPanel: Go to Cron Jobs, set the interval to "Once Per Minute (* * * * *)", and enter the command above.
Plesk: Go to Scheduled Tasks, add a new task with the command above, and set the schedule to every minute.
VPS / dedicated: Add the cron entry via crontab -e for the web server user (e.g. www-data).
Without cron, recurring invoices and automatic reminders do not fire. You can still run them manually from the command line.
Queue (optional)
If you use the database queue driver (default), scheduled tasks and email delivery run synchronously. For background processing:
| Command | Description |
|---|---|
php artisan queue:work |
Start the queue worker (processes queued jobs) |
php artisan queue:restart |
Restart queue workers after code changes |
Queue workers are optional. InvoiceScript works without them on shared hosting.
Database
| Command | Description |
|---|---|
php artisan migrate:status |
Check migration status |
php artisan migrate:rollback |
Roll back the last batch of migrations |
Production optimization
Run these after deploying or updating InvoiceScript:
php artisan config:cache
php artisan route:cache
php artisan view:cache
Related pages
Ready to build?
One-time purchase. Self-hosted. Own every file forever.