1. Go to this page and download the library: Download banelsems/lara-sgmef-qr library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namespace App\Sgmef;
use Banelsems\LaraSgmefQr\Contracts\IfuResolverInterface;
class TenantIfuResolver implements IfuResolverInterface
{
public function resolve(?string $context = null): string
{
return tenant($context)->ifu;
}
}
use App\Sgmef\TenantIfuResolver;
use Banelsems\LaraSgmefQr\Contracts\IfuResolverInterface;
$this->app->bind(IfuResolverInterface::class, TenantIfuResolver::class);
use Banelsems\LaraSgmefQr\Jobs\CreateInvoiceJob;
use Banelsems\LaraSgmefQr\Jobs\ConfirmInvoiceJob;
use Banelsems\LaraSgmefQr\Jobs\CleanupExpiredPendingInvoicesJob;
CreateInvoiceJob::dispatch($data)->onQueue('sgmef');
ConfirmInvoiceJob::dispatch($invoice->uid)->onQueue('sgmef');
CleanupExpiredPendingInvoicesJob::dispatch()->onQueue('sgmef');
// app/Console/Kernel.php
use Banelsems\LaraSgmefQr\Jobs\CleanupExpiredPendingInvoicesJob;
$schedule->job(new CleanupExpiredPendingInvoicesJob())->everyMinute();
use Banelsems\LaraSgmefQr\Services\TaxCalculatorService;
use Banelsems\LaraSgmefQr\Services\QrCodeService;
use Banelsems\LaraSgmefQr\Services\StatExportService;
$taxes = app(TaxCalculatorService::class)->calculateInvoice($data->items);
$verificationUrl = app(QrCodeService::class)->verificationUrl($confirmedInvoice);
$csvPath = app(StatExportService::class)->exportCsv(now()->startOfMonth(), now()->endOfMonth());
use Banelsems\LaraSgmefQr\Enums\InvoiceStatusEnum;
InvoiceStatusEnum::PENDING;
InvoiceStatusEnum::CONFIRMED;
InvoiceStatusEnum::CANCELLED;
InvoiceStatusEnum::ERROR;