🎉 First commit

This commit is contained in:
2026-02-20 08:40:00 +01:00
commit 07a3b3a874
206 changed files with 22834 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
<?php
namespace App\Filament\Pages;
use App\Services\LogisticsService;
use Filament\Pages\Page;
use Filament\Support\Icons\Heroicon;
class Documents extends Page
{
protected static string|\BackedEnum|null $navigationIcon = Heroicon::OutlinedDocumentText;
protected static ?string $navigationLabel = 'Documents';
protected static ?string $title = 'Documents';
protected static ?int $navigationSort = 3;
protected string $view = 'filament.pages.documents';
public string $select = 'jnl,number,thirdid,date';
public string $thirdId = '';
public string $detailJnl = '';
public string $detailNumber = '';
public array $data = [];
public array $detailData = [];
public ?array $metadata = null;
public ?string $errorMessage = null;
public function searchDocuments(): void
{
try {
$service = app(LogisticsService::class);
$params = array_filter([
'select' => $this->select,
'thirdid' => $this->thirdId,
]);
$response = $service->documentList($params);
$this->data = $response['data'] ?? [];
$this->metadata = $response['metadata'] ?? null;
$this->errorMessage = $response['error'] ?? null;
} catch (\Throwable $e) {
$this->errorMessage = $e->getMessage();
$this->data = [];
}
}
public function getDocumentDetail(): void
{
if (blank($this->detailJnl) || blank($this->detailNumber)) {
return;
}
try {
$service = app(LogisticsService::class);
$response = $service->documentDetail($this->detailJnl, $this->detailNumber);
$this->detailData = $response['data'] ?? [];
$this->errorMessage = $response['error'] ?? null;
} catch (\Throwable $e) {
$this->errorMessage = $e->getMessage();
$this->detailData = [];
}
}
}