Skip to content

Commit

Permalink
Allow for nullable records
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyTWF committed Jan 20, 2023
1 parent d222e8f commit 9b2fad0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Filament/Resources/EventResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ public static function form(Form $form): Form
->hintIcon('heroicon-o-folder')
->searchable()
->options(
fn (Event $record) =>
fn (?Event $record) =>
in_array(auth()->user()->role->key, [
RoleKey::SYSTEM,
RoleKey::NMT
]) ? self::setFirOptions(FlightInformationRegion::all()) :
self::setFirOptions(collect([$record->flightInformationRegion->id => $record->flightInformationRegion])->merge(auth()->user()
self::setFirOptions(collect(is_null($record) ? [] : [$record->flightInformationRegion->id => $record->flightInformationRegion])->merge(auth()->user()
->flightInformationRegions))
)
->required(),
Expand Down

0 comments on commit 9b2fad0

Please sign in to comment.