🎉 First commit
This commit is contained in:
54
app/Filament/Pages/Journaux.php
Normal file
54
app/Filament/Pages/Journaux.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Services\LogisticsService;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
|
||||
class Journaux extends Page
|
||||
{
|
||||
protected static string|\BackedEnum|null $navigationIcon = Heroicon::OutlinedBookOpen;
|
||||
|
||||
protected static ?string $navigationLabel = 'Journaux';
|
||||
|
||||
protected static ?string $title = 'Journaux';
|
||||
|
||||
protected static ?int $navigationSort = 4;
|
||||
|
||||
protected string $view = 'filament.pages.journaux';
|
||||
|
||||
public string $select = '';
|
||||
|
||||
public int $results = 10;
|
||||
|
||||
public string $type = '';
|
||||
|
||||
public array $data = [];
|
||||
|
||||
public ?array $metadata = null;
|
||||
|
||||
public ?string $errorMessage = null;
|
||||
|
||||
public function searchJournaux(): void
|
||||
{
|
||||
try {
|
||||
$service = app(LogisticsService::class);
|
||||
|
||||
$params = array_filter([
|
||||
'select' => $this->select,
|
||||
'results' => $this->results,
|
||||
'TYPE' => $this->type,
|
||||
]);
|
||||
|
||||
$response = $service->jnlList($params);
|
||||
|
||||
$this->data = $response['data'] ?? [];
|
||||
$this->metadata = $response['metadata'] ?? null;
|
||||
$this->errorMessage = $response['error'] ?? null;
|
||||
} catch (\Throwable $e) {
|
||||
$this->errorMessage = $e->getMessage();
|
||||
$this->data = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user