Skip to content

Commit db06b58

Browse files
authored
Merge pull request #357 from ECFMP/event-fir-name-not-showing
fix: display events fir properly for non-editors
2 parents fe4e3f5 + 9b2fad0 commit db06b58

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/Filament/Resources/EventResource.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,13 @@ public static function form(Form $form): Form
6060
->hintIcon('heroicon-o-folder')
6161
->searchable()
6262
->options(
63+
fn (?Event $record) =>
6364
in_array(auth()->user()->role->key, [
6465
RoleKey::SYSTEM,
6566
RoleKey::NMT
6667
]) ? self::setFirOptions(FlightInformationRegion::all()) :
67-
self::setFirOptions(auth()->user()
68-
->flightInformationRegions)
68+
self::setFirOptions(collect(is_null($record) ? [] : [$record->flightInformationRegion->id => $record->flightInformationRegion])->merge(auth()->user()
69+
->flightInformationRegions))
6970
)
7071
->required(),
7172
Forms\Components\DateTimePicker::make('date_start')

0 commit comments

Comments
 (0)