Skip to content

Commit

Permalink
Small eager loading bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GeniJaho committed Jan 14, 2024
1 parent e93c7c3 commit eacdf1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Filament/Resources/PhotoResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ public static function table(Table $table): Table
ImageColumn::make('path')
->label('Photo')
->searchable(),
TextColumn::make('gps')
->label('GPS')
->getStateUsing(fn (Photo $photo): ?string => $photo->latitude && $photo->longitude
? "{$photo->latitude}, {$photo->longitude}"
: null
),
TextColumn::make('created_at')
->dateTime()
->sortable()
Expand Down
2 changes: 2 additions & 0 deletions app/Filament/Resources/UserResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Filament\Tables\Columns\ImageColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;

class UserResource extends Resource
{
Expand Down Expand Up @@ -66,6 +67,7 @@ public static function table(Table $table): Table
->sortable()
->toggleable(isToggledHiddenByDefault: true),
])
->modifyQueryUsing(fn (Builder $query) => $query->with(['currentTeam', 'ownedTeams']))
->filters([
//
])
Expand Down

0 comments on commit eacdf1c

Please sign in to comment.