Der Kalenderabgleich alle 5 Minuten hat jede fortbestehende Ueberschneidung erneut gemailt. ReportChannelConflicts legt jede Ueberschneidung einmal im neuen Postfach (InboxMessage, Fingerabdruck je Mandant) ab und mailt nur neue. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39 lines
1.2 KiB
PHP
39 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\InboxMessages\Pages;
|
|
|
|
use App\Filament\Concerns\ListsCurrentProperty;
|
|
use App\Filament\Resources\InboxMessages\InboxMessageResource;
|
|
use App\Models\Property;
|
|
use Filament\Actions\Action;
|
|
use Filament\Resources\Pages\ListRecords;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
|
class ListInboxMessages extends ListRecords
|
|
{
|
|
use ListsCurrentProperty;
|
|
|
|
protected static string $resource = InboxMessageResource::class;
|
|
|
|
/**
|
|
* Messages of the chosen apartment and those that concern no apartment in particular.
|
|
*/
|
|
protected function scopeToProperty(Builder $query, Property $property): Builder
|
|
{
|
|
return $query->where(fn (Builder $query) => $query->where('property_id', $property->id)->orWhereNull('property_id'));
|
|
}
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
Action::make('readAll')
|
|
->label('Alle als gelesen markieren')
|
|
->icon(Heroicon::OutlinedCheck)
|
|
->color('gray')
|
|
->visible(fn (): bool => $this->getTableQuery()->unread()->exists())
|
|
->action(fn () => $this->getTableQuery()->unread()->update(['read_at' => now()])),
|
|
];
|
|
}
|
|
}
|