37 lines
840 B
PHP
37 lines
840 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use Illuminate\Console\Command;
|
|
use App\Models\InvoiceItem;
|
|
use App\Models\Invoice;
|
|
use Carbon\Carbon;
|
|
use App\Services\InvoiceService;
|
|
use Illuminate\Console\Scheduling\Schedule;
|
|
|
|
class GenerateMonthlyInvoices extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
// protected $signature = 'app:generate-monthly-invoices';
|
|
protected $signature = 'invoice:generate-monthly'; // pakai yang ini!
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Generate invoices for completed trips automatically every month';
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*/
|
|
public function handle()
|
|
{
|
|
app(InvoiceService::class)->generateMonthlyInvoices();
|
|
}
|
|
}
|