diff --git a/app/Filament/Resources/Threads/Pages/ListThreads.php b/app/Filament/Resources/Threads/Pages/ListThreads.php new file mode 100644 index 000000000..ff26f2f93 --- /dev/null +++ b/app/Filament/Resources/Threads/Pages/ListThreads.php @@ -0,0 +1,12 @@ +columns([ + ImageColumn::make('authorRelation.github_id') + ->label('Author') + ->circular() + ->defaultImageUrl(fn(?string $state): string => $state ? sprintf('https://avatars.githubusercontent.com/u/%s', $state) : asset('images/laravelio-icon-gray.svg')), + + TextColumn::make('authorRelation.name') + ->label('') + ->description(fn(Thread $thread): ?string => $thread->authorRelation->username) + ->searchable(), + + TextColumn::make('subject') + ->searchable(), + + TextColumn::make('last_activity_at') + ->dateTime() + ->sortable(), + + TextColumn::make('locked_at') + ->dateTime() + ->sortable(), + + TextColumn::make('created_at') + ->dateTime() + ->sortable() + ->toggleable(isToggledHiddenByDefault: true), + + TextColumn::make('updated_at') + ->dateTime() + ->sortable() + ->toggleable(isToggledHiddenByDefault: true), + ]) + ->recordActions([ + Action::make('view') + ->url(fn(Thread $thread): string => route('thread', $thread->slug())) + ->openUrlInNewTab() + ->icon('heroicon-s-eye'), + + ]) + ->toolbarActions([ + BulkActionGroup::make([ + DeleteBulkAction::make(), + ]), + ]); + } +} diff --git a/app/Filament/Resources/Threads/ThreadResource.php b/app/Filament/Resources/Threads/ThreadResource.php new file mode 100644 index 000000000..bdb58ee3e --- /dev/null +++ b/app/Filament/Resources/Threads/ThreadResource.php @@ -0,0 +1,43 @@ + ListThreads::route('/'), + ]; + } +}