mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-08-04 07:02:13 +00:00
fix(recurring-invoices): scale scheduled generation
This commit is contained in:
25
app/Console/Commands/GenerateRecurringInvoices.php
Normal file
25
app/Console/Commands/GenerateRecurringInvoices.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Services\Document\RecurringInvoiceService;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class GenerateRecurringInvoices extends Command
|
||||
{
|
||||
protected $signature = 'generate:recurring-invoices';
|
||||
|
||||
protected $description = 'Generate due recurring invoices.';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle(RecurringInvoiceService $recurringInvoiceService): int
|
||||
{
|
||||
$generated = $recurringInvoiceService->generateDueInvoices();
|
||||
|
||||
$this->info("Generated {$generated} recurring invoice(s).");
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user