Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Successful in 14s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 10s
Laravel Larastan / larastan (pull_request) Failing after 2m24s
Laravel Pint / pint (pull_request) Failing after 2m35s
59 lines
1.6 KiB
PHP
59 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Pages;
|
|
|
|
use App\Models\RequestQuotation;
|
|
use Filament\Pages\Page;
|
|
use Filament\Forms\Components\Section;
|
|
use Filament\Forms\Components\Select;
|
|
use Filament\Forms\Form;
|
|
use Filament\Pages\Dashboard\Concerns\HasFiltersForm;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class RfqOverview extends Page
|
|
{
|
|
protected static ?string $navigationIcon = 'heroicon-o-document-text';
|
|
|
|
protected static string $view = 'filament.pages.rfq-overview';
|
|
|
|
protected static ?string $navigationGroup = 'RFQ Dashboard';
|
|
|
|
use HasFiltersForm;
|
|
|
|
public function mount(): void
|
|
{
|
|
session()->forget(['rfq_id']);
|
|
$this->filtersForm->fill([
|
|
'rfq_id' => null
|
|
]);
|
|
}
|
|
|
|
public function filtersForm(Form $form): Form
|
|
{
|
|
return $form
|
|
->statePath('filters')
|
|
->schema([
|
|
Section::make('')
|
|
->schema([
|
|
Select::make('rfq_number')
|
|
->label('Select RFQ Number')
|
|
->reactive()
|
|
->options(function (callable $get) {
|
|
return RequestQuotation::orderBy('rfq_number')
|
|
->pluck('rfq_number', 'id')
|
|
->toArray();
|
|
})
|
|
->afterStateUpdated(function ($state, callable $set) {
|
|
session(['rfq_id' => $state]);
|
|
}),
|
|
])
|
|
->columns(1),
|
|
]);
|
|
}
|
|
|
|
public static function canAccess(): bool
|
|
{
|
|
return Auth::check() && Auth::user()->can('view rfq overview dashboard');
|
|
}
|
|
}
|