tenant admin startseite schicker gestaltet und super-admin und tenant admin (filament) aufgesplittet.
Es gibt nun task collections und vordefinierte tasks für alle. Onboarding verfeinert und webseite-carousel gefixt (logging später entfernen!)
This commit is contained in:
46
app/Filament/Tenant/Widgets/EventsActiveToday.php
Normal file
46
app/Filament/Tenant/Widgets/EventsActiveToday.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Tenant\Widgets;
|
||||
|
||||
use Filament\Tables;
|
||||
use Filament\Widgets\TableWidget as BaseWidget;
|
||||
use Illuminate\Support\Carbon;
|
||||
use App\Models\Event;
|
||||
|
||||
class EventsActiveToday extends BaseWidget
|
||||
{
|
||||
protected static ?string $heading = null;
|
||||
|
||||
public function getHeading()
|
||||
{
|
||||
return __('admin.widgets.events_active_today.heading');
|
||||
}
|
||||
protected ?string $pollingInterval = '60s';
|
||||
|
||||
public function table(Tables\Table $table): Tables\Table
|
||||
{
|
||||
$today = Carbon::today()->toDateString();
|
||||
return $table
|
||||
->query(
|
||||
Event::query()
|
||||
->where('is_active', true)
|
||||
->whereDate('date', '<=', $today)
|
||||
->withCount([
|
||||
'photos as uploads_today' => function ($q) use ($today) {
|
||||
$q->whereDate('created_at', $today);
|
||||
},
|
||||
])
|
||||
->orderByDesc('date')
|
||||
->limit(10)
|
||||
)
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('id')->label(__('admin.common.hash'))->width('60px'),
|
||||
Tables\Columns\TextColumn::make('slug')->label(__('admin.common.slug'))->searchable(),
|
||||
Tables\Columns\TextColumn::make('date')->date(),
|
||||
Tables\Columns\TextColumn::make('uploads_today')->label(__('admin.common.uploads_today'))->numeric(),
|
||||
])
|
||||
->paginated(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user