diff --git a/resources/views/components/incident.blade.php b/resources/views/components/incident.blade.php index 33f731db..b9bbbba5 100644 --- a/resources/views/components/incident.blade.php +++ b/resources/views/components/incident.blade.php @@ -69,8 +69,12 @@ @empty -
- {{ __('No incidents reported.') }} +
+
+
+ {{ __('No incidents reported.') }} +
+
@endforelse
diff --git a/src/Filament/Resources/ComponentGroupResource.php b/src/Filament/Resources/ComponentGroupResource.php index 7371185e..4203cee5 100644 --- a/src/Filament/Resources/ComponentGroupResource.php +++ b/src/Filament/Resources/ComponentGroupResource.php @@ -25,16 +25,19 @@ public static function form(Form $form): Form ->schema([ Forms\Components\Section::make()->columns(2)->schema([ Forms\Components\TextInput::make('name') + ->label(__('Name')) ->required() ->maxLength(255) ->columnSpanFull(), Forms\Components\ToggleButtons::make('visible') + ->label(__('Visible')) ->inline() ->options(ResourceVisibilityEnum::class) ->default(ResourceVisibilityEnum::guest) ->required() ->columnSpanFull(), Forms\Components\ToggleButtons::make('collapsed') + ->label(__('Collapsed')) ->required() ->inline() ->options(ComponentGroupVisibilityEnum::class) @@ -49,17 +52,22 @@ public static function table(Table $table): Table return $table ->columns([ Tables\Columns\TextColumn::make('name') + ->label(__('Name')) ->searchable(), Tables\Columns\TextColumn::make('visible') + ->label(__('Visible')) ->badge() ->sortable(), Tables\Columns\TextColumn::make('collapsed') + ->label(__('Collapsed')) ->sortable(), Tables\Columns\TextColumn::make('created_at') + ->label(__('Created at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') + ->label(__('Updated at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), @@ -97,4 +105,9 @@ public static function getLabel(): ?string { return __('Component Group'); } + + public static function getPluralLabel(): ?string + { + return __('Component Groups'); + } } diff --git a/src/Filament/Resources/ComponentResource.php b/src/Filament/Resources/ComponentResource.php index 3aa4e8ec..48202841 100644 --- a/src/Filament/Resources/ComponentResource.php +++ b/src/Filament/Resources/ComponentResource.php @@ -23,14 +23,17 @@ public static function form(Form $form): Form ->schema([ Forms\Components\Section::make()->columns(2)->schema([ Forms\Components\TextInput::make('name') + ->label(__('Name')) ->required() ->maxLength(255), Forms\Components\ToggleButtons::make('status') + ->label(__('Status')) ->inline() ->columnSpanFull() ->options(ComponentStatusEnum::class) ->required(), Forms\Components\MarkdownEditor::make('description') + ->label(__('Description')) ->maxLength(255) ->columnSpanFull(), Forms\Components\Select::make('component_group_id') @@ -39,6 +42,7 @@ public static function form(Form $form): Form ->preload() ->label(__('Component Group')), Forms\Components\TextInput::make('link') + ->label(__('Link')) ->url() ->hint(__('An optional link to the component.')), ]), @@ -57,28 +61,36 @@ public static function table(Table $table): Table return $table ->columns([ Tables\Columns\TextColumn::make('name') + ->label(__('Name')) ->searchable(), Tables\Columns\TextColumn::make('status') + ->label(__('Status')) ->badge() ->sortable(), Tables\Columns\TextColumn::make('order') + ->label(__('Order')) ->numeric() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('group.name') + ->label(__('Group')) ->sortable(), Tables\Columns\IconColumn::make('enabled') + ->label(__('Enabled')) ->boolean() ->toggleable(isToggledHiddenByDefault: false), Tables\Columns\TextColumn::make('created_at') + ->label(__('Created at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') + ->label(__('Updated at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('deleted_at') + ->label(__('Deleted at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), @@ -118,6 +130,11 @@ public static function getLabel(): ?string return __('Component'); } + public static function getPluralLabel(): ?string + { + return __('Components'); + } + public static function getNavigationBadge(): ?string { return static::getModel()::outage()->count(); diff --git a/src/Filament/Resources/ComponentResource/RelationManagers/ComponentsRelationManager.php b/src/Filament/Resources/ComponentResource/RelationManagers/ComponentsRelationManager.php index e1a613a9..dc8cd001 100644 --- a/src/Filament/Resources/ComponentResource/RelationManagers/ComponentsRelationManager.php +++ b/src/Filament/Resources/ComponentResource/RelationManagers/ComponentsRelationManager.php @@ -8,27 +8,37 @@ use Filament\Resources\RelationManagers\RelationManager; use Filament\Tables; use Filament\Tables\Table; +use Illuminate\Database\Eloquent\Model; class ComponentsRelationManager extends RelationManager { protected static string $relationship = 'components'; + public static function getTitle(Model $ownerRecord, string $pageClass): string + { + return __('Components'); + } + public function form(Form $form): Form { return $form ->schema([ Forms\Components\TextInput::make('name') + ->label(__('Name')) ->required() ->maxLength(255), Forms\Components\ToggleButtons::make('status') + ->label(__('Status')) ->inline() ->columnSpanFull() ->options(ComponentStatusEnum::class) ->required(), Forms\Components\MarkdownEditor::make('description') + ->label(__('Description')) ->maxLength(255) ->columnSpanFull(), Forms\Components\TextInput::make('link') + ->label(__('Link')) ->url() ->hint(__('An optional link to the component.')), ]); @@ -38,12 +48,17 @@ public function table(Table $table): Table { return $table ->recordTitleAttribute('name') + ->modelLabel(__('Component')) + ->pluralModelLabel(__('Components')) ->columns([ - Tables\Columns\TextColumn::make('name'), + Tables\Columns\TextColumn::make('name') + ->label(__('Name')), Tables\Columns\TextColumn::make('status') + ->label(__('Status')) ->badge() ->sortable(), Tables\Columns\IconColumn::make('enabled') + ->label(__('Enabled')) ->boolean() ->toggleable(isToggledHiddenByDefault: false), ]) diff --git a/src/Filament/Resources/IncidentResource.php b/src/Filament/Resources/IncidentResource.php index 6f599b59..b8a0d9cd 100644 --- a/src/Filament/Resources/IncidentResource.php +++ b/src/Filament/Resources/IncidentResource.php @@ -30,19 +30,24 @@ public static function form(Form $form): Form ->schema([ Section::make()->schema([ Forms\Components\TextInput::make('name') + ->label(__('Name')) ->required() ->maxLength(255), Forms\Components\ToggleButtons::make('status') + ->label(__('Status')) ->inline() ->columnSpanFull() ->options(IncidentStatusEnum::class) ->required(), Forms\Components\MarkdownEditor::make('message') + ->label(__('Message')) ->required() ->columnSpanFull(), Forms\Components\DateTimePicker::make('occurred_at') + ->label(__('Occurred at')) ->helperText(__('The incident\'s created timestamp will be used if left empty.')), Forms\Components\ToggleButtons::make('visible') + ->label(__('Visible')) ->inline() ->options(ResourceVisibilityEnum::class) ->default(ResourceVisibilityEnum::guest) @@ -85,17 +90,22 @@ public static function table(Table $table): Table return $table ->columns([ Tables\Columns\TextColumn::make('name') + ->label(__('Name')) ->searchable(), Tables\Columns\TextColumn::make('status') + ->label(__('Status')) ->sortable() ->badge(), Tables\Columns\TextColumn::make('visible') + ->label(__('Visible')) ->sortable() ->badge(), Tables\Columns\IconColumn::make('stickied') + ->label(__('Stickied')) ->toggleable(isToggledHiddenByDefault: true) ->boolean(), Tables\Columns\TextColumn::make('occurred_at') + ->label(__('Occurred at')) ->dateTime() ->sortable(), Tables\Columns\IconColumn::make('notifications') @@ -103,14 +113,17 @@ public static function table(Table $table): Table ->boolean() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('created_at') + ->label(__('Created at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: false), Tables\Columns\TextColumn::make('updated_at') + ->label(__('Updated at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('deleted_at') + ->label(__('Deleted at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), @@ -118,6 +131,7 @@ public static function table(Table $table): Table ->filters([ Tables\Filters\TrashedFilter::make(), Tables\Filters\SelectFilter::make('status') + ->label(__('Status')) ->options(IncidentStatusEnum::class), ]) ->actions([ @@ -135,8 +149,11 @@ public static function table(Table $table): Table ->send(); }) ->form([ - Forms\Components\MarkdownEditor::make('message')->required(), + Forms\Components\MarkdownEditor::make('message') + ->label(__('Message')) + ->required(), Forms\Components\ToggleButtons::make('status') + ->label(__('Status')) ->options(IncidentStatusEnum::class) ->inline() ->required(), @@ -177,6 +194,11 @@ public static function getLabel(): ?string return __('Incident'); } + public static function getPluralLabel(): ?string + { + return __('Incidents'); + } + public static function getNavigationBadge(): ?string { return static::getModel()::unresolved()->count(); diff --git a/src/Filament/Resources/IncidentResource/RelationManagers/ComponentsRelationManager.php b/src/Filament/Resources/IncidentResource/RelationManagers/ComponentsRelationManager.php index cfa83f47..eb1cc85b 100644 --- a/src/Filament/Resources/IncidentResource/RelationManagers/ComponentsRelationManager.php +++ b/src/Filament/Resources/IncidentResource/RelationManagers/ComponentsRelationManager.php @@ -9,18 +9,26 @@ use Filament\Resources\RelationManagers\RelationManager; use Filament\Tables; use Filament\Tables\Table; +use Illuminate\Database\Eloquent\Model; class ComponentsRelationManager extends RelationManager { protected static string $relationship = 'components'; + public static function getTitle(Model $ownerRecord, string $pageClass): string + { + return __('Components'); + } + public function form(Form $form): Form { return $form ->schema([ Forms\Components\TextInput::make('name') + ->label(__('Name')) ->searchable(), Forms\Components\ToggleButtons::make('status') + ->label(__('Status')) ->inline() ->options(ComponentStatusEnum::class) ->required(), @@ -31,9 +39,13 @@ public function table(Table $table): Table { return $table ->recordTitleAttribute('name') + ->modelLabel(__('Component')) + ->pluralModelLabel(__('Components')) ->columns([ - Tables\Columns\TextColumn::make('name'), + Tables\Columns\TextColumn::make('name') + ->label(__('Name')), Tables\Columns\TextColumn::make('status') + ->label(__('Status')) ->badge() ->sortable(), ]) @@ -45,6 +57,7 @@ public function table(Table $table): Table ->form(fn (Tables\Actions\AttachAction $action): array => [ $action->getRecordSelect(), Forms\Components\ToggleButtons::make('status') + ->label(__('Status')) ->inline() ->columnSpanFull() ->options(ComponentStatusEnum::class) diff --git a/src/Filament/Resources/IncidentResource/RelationManagers/IncidentUpdatesRelationManager.php b/src/Filament/Resources/IncidentResource/RelationManagers/IncidentUpdatesRelationManager.php index 0ecf4155..6d360df2 100644 --- a/src/Filament/Resources/IncidentResource/RelationManagers/IncidentUpdatesRelationManager.php +++ b/src/Filament/Resources/IncidentResource/RelationManagers/IncidentUpdatesRelationManager.php @@ -8,38 +8,50 @@ use Filament\Resources\RelationManagers\RelationManager; use Filament\Tables; use Filament\Tables\Table; +use Illuminate\Database\Eloquent\Model; class IncidentUpdatesRelationManager extends RelationManager { protected static string $relationship = 'incidentUpdates'; + public static function getTitle(Model $ownerRecord, string $pageClass): string + { + return __('Incident Updates'); + } + public function form(Form $form): Form { return $form ->schema([ Forms\Components\MarkdownEditor::make('message') + ->label(__('Message')) ->required() ->columnSpanFull(), Forms\Components\Select::make('user_id') + ->label(__('User')) ->hint(__('The user who reported the incident.')) ->relationship('user', 'name') ->searchable() ->preload() ->createOptionForm([ Forms\Components\TextInput::make('name') + ->label(__('Name')) ->required() ->maxLength(255), Forms\Components\TextInput::make('email') + ->label(__('Email')) ->required() ->email() ->maxLength(255), Forms\Components\TextInput::make('password') + ->label(__('Password')) ->required() ->password() ->confirmed() ->minLength(8), ]), Forms\Components\ToggleButtons::make('status') + ->label(__('Status')) ->inline() ->columnSpanFull() ->options(IncidentStatusEnum::class) @@ -51,26 +63,34 @@ public function table(Table $table): Table { return $table ->recordTitleAttribute('title') + ->modelLabel(__('Incident Update')) + ->pluralModelLabel(__('Incident Updates')) ->columns([ Tables\Columns\TextColumn::make('incident.name') + ->label(__('Incident')) ->numeric() ->sortable(), Tables\Columns\TextColumn::make('status') + ->label(__('Status')) ->badge() ->sortable(), Tables\Columns\TextColumn::make('user.name') + ->label(__('User')) ->sortable(), Tables\Columns\TextColumn::make('created_at') + ->label(__('Created at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') + ->label(__('Updated at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), ]) ->filters([ Tables\Filters\SelectFilter::make('status') + ->label(__('Status')) ->options(IncidentStatusEnum::class), ]) ->headerActions([ diff --git a/src/Filament/Resources/IncidentTemplateResource.php b/src/Filament/Resources/IncidentTemplateResource.php index aca82950..b2bfe7d7 100644 --- a/src/Filament/Resources/IncidentTemplateResource.php +++ b/src/Filament/Resources/IncidentTemplateResource.php @@ -28,12 +28,15 @@ public static function form(Form $form): Form ->schema([ Forms\Components\Section::make()->columns(2)->schema([ Forms\Components\TextInput::make('name') + ->label(__('Name')) ->required() ->live(debounce: 250) ->afterStateUpdated(fn (Set $set, ?string $state) => $set('slug', Str::slug($state))), Forms\Components\TextInput::make('slug') + ->label(__('Slug')) ->required(), Forms\Components\Textarea::make('template') + ->label(__('Template')) ->hint(fn (Get $get) => new HtmlString(Blade::render(match ($get('engine')) { IncidentTemplateEngineEnum::twig => 'Twig Documentation', IncidentTemplateEngineEnum::blade => 'Laravel Blade Documentation', @@ -43,6 +46,7 @@ public static function form(Form $form): Form ->rows(8) ->columnSpanFull(), Forms\Components\Select::make('engine') + ->label(__('Engine')) ->options(IncidentTemplateEngineEnum::class) ->default(IncidentTemplateEngineEnum::twig) ->live() @@ -56,22 +60,28 @@ public static function table(Table $table): Table return $table ->columns([ Tables\Columns\TextColumn::make('name') + ->label(__('Name')) ->searchable(), Tables\Columns\TextColumn::make('slug') + ->label(__('Slug')) ->searchable(), Tables\Columns\TextColumn::make('engine') + ->label(__('Engine')) ->sortable() ->badge() ->searchable(), Tables\Columns\TextColumn::make('created_at') + ->label(__('Created at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') + ->label(__('Updated at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('deleted_at') + ->label(__('Deleted at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), @@ -109,4 +119,9 @@ public static function getLabel(): ?string { return __('Incident Template'); } + + public static function getPluralLabel(): ?string + { + return __('Incident Templates'); + } } diff --git a/src/Filament/Resources/MetricResource.php b/src/Filament/Resources/MetricResource.php index 05a7c67d..78e29500 100644 --- a/src/Filament/Resources/MetricResource.php +++ b/src/Filament/Resources/MetricResource.php @@ -25,17 +25,21 @@ public static function form(Form $form): Form ->schema([ Forms\Components\Section::make()->columns(4)->schema([ Forms\Components\TextInput::make('name') + ->label(__('Name')) ->required() ->maxLength(255) ->columnSpan(3), Forms\Components\TextInput::make('suffix') + ->label(__('Suffix')) ->required() ->maxLength(255) ->placeholder('e.g. ms, %, etc.'), Forms\Components\MarkdownEditor::make('description') + ->label(__('Description')) ->maxLength(255) ->columnSpanFull(), Forms\Components\ToggleButtons::make('default_view') + ->label(__('Default view')) ->options(MetricViewEnum::class) ->inline() ->required() @@ -51,11 +55,13 @@ public static function form(Form $form): Form ->default(MetricTypeEnum::sum) ->columnSpan(2), Forms\Components\TextInput::make('places') + ->label(__('Places')) ->required() ->numeric() ->default(2) ->columnSpan(2), Forms\Components\TextInput::make('threshold') + ->label(__('Threshold')) ->required() ->numeric() ->default(5) @@ -63,11 +69,13 @@ public static function form(Form $form): Form ])->columnSpan(3), Forms\Components\Section::make()->schema([ Forms\Components\ToggleButtons::make('visible') + ->label(__('Visible')) ->inline() ->options(ResourceVisibilityEnum::class) ->default(ResourceVisibilityEnum::guest) ->required(), Forms\Components\Toggle::make('display_chart') + ->label(__('Display chart')) ->default(true) ->required(), @@ -80,43 +88,57 @@ public static function table(Table $table): Table return $table ->columns([ Tables\Columns\TextColumn::make('name') + ->label(__('Name')) ->searchable(), Tables\Columns\TextColumn::make('suffix') + ->label(__('Suffix')) ->fontFamily('mono') ->searchable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('default_value') + ->label(__('Default value')) ->numeric() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('calc_type') + ->label(__('Metric Type')) ->badge() ->sortable(), Tables\Columns\IconColumn::make('display_chart') + ->label(__('Display chart')) ->boolean(), Tables\Columns\TextColumn::make('places') + ->label(__('Places')) ->numeric() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('default_view') + ->label(__('Default view')) ->sortable(), Tables\Columns\TextColumn::make('threshold') + ->label(__('Threshold')) ->numeric() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('order') + ->label(__('Order')) ->numeric() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('visible') + ->label(__('Visible')) ->badge() ->sortable(), - Tables\Columns\TextColumn::make('points_count')->counts('metricPoints'), + Tables\Columns\TextColumn::make('points_count') + ->label(__('Points count')) + ->counts('metricPoints'), Tables\Columns\TextColumn::make('created_at') + ->label(__('Created at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') + ->label(__('Updated at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), @@ -136,6 +158,16 @@ public static function table(Table $table): Table ->defaultSort('order'); } + public static function getLabel(): ?string + { + return __('Metric'); + } + + public static function getPluralLabel(): ?string + { + return __('Metrics'); + } + public static function getRelations(): array { return [ diff --git a/src/Filament/Resources/ScheduleResource.php b/src/Filament/Resources/ScheduleResource.php index 15a3efba..379e7749 100644 --- a/src/Filament/Resources/ScheduleResource.php +++ b/src/Filament/Resources/ScheduleResource.php @@ -23,8 +23,10 @@ public static function form(Form $form): Form ->schema([ Forms\Components\Section::make()->schema([ Forms\Components\TextInput::make('name') + ->label(__('Name')) ->required(), Forms\Components\Select::make('status') + ->label(__('Status')) ->required() ->options(ScheduleStatusEnum::class) ->default(ScheduleStatusEnum::upcoming) @@ -35,12 +37,15 @@ public static function form(Form $form): Form }) ->live(), Forms\Components\MarkdownEditor::make('message') + ->label(__('Message')) ->columnSpanFull(), ])->columnSpan(3), Forms\Components\Section::make()->schema([ Forms\Components\DateTimePicker::make('scheduled_at') + ->label(__('Scheduled at')) ->required(), Forms\Components\DateTimePicker::make('completed_at') + ->label(__('Completed at')) ->visible(fn (Forms\Get $get): bool => ScheduleStatusEnum::parse($get('status')) === ScheduleStatusEnum::complete) ->required(fn (Forms\Get $get): bool => ScheduleStatusEnum::parse($get('status')) === ScheduleStatusEnum::complete), ])->columnSpan(1), @@ -52,25 +57,32 @@ public static function table(Table $table): Table return $table ->columns([ Tables\Columns\TextColumn::make('name') + ->label(__('Name')) ->searchable(), Tables\Columns\TextColumn::make('status') + ->label(__('Status')) ->badge() ->sortable(), Tables\Columns\TextColumn::make('scheduled_at') + ->label(__('Scheduled at')) ->dateTime() ->sortable(), Tables\Columns\TextColumn::make('completed_at') + ->label(__('Completed at')) ->dateTime() ->sortable(), Tables\Columns\TextColumn::make('created_at') + ->label(__('Created at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') + ->label(__('Updated at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('deleted_at') + ->label(__('Deleted at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), @@ -111,6 +123,11 @@ public static function getLabel(): ?string return __('Schedule'); } + public static function getPluralLabel(): ?string + { + return __('Schedules'); + } + public static function getNavigationBadge(): ?string { return static::getModel()::incomplete()->count(); diff --git a/src/Filament/Resources/SubscriberResource.php b/src/Filament/Resources/SubscriberResource.php index db1c2e5b..4f794ade 100644 --- a/src/Filament/Resources/SubscriberResource.php +++ b/src/Filament/Resources/SubscriberResource.php @@ -23,15 +23,19 @@ public static function form(Form $form): Form ->schema([ Forms\Components\Section::make()->columns(2)->schema([ Forms\Components\TextInput::make('email') + ->label(__('Email')) ->email() ->required() ->maxLength(255), Forms\Components\TextInput::make('verify_code') + ->label(__('Verify code')) ->required() ->default(fn () => Str::random()) ->maxLength(255), - Forms\Components\DateTimePicker::make('verified_at'), + Forms\Components\DateTimePicker::make('verified_at') + ->label(__('Verified at')), Forms\Components\Toggle::make('global') + ->label(__('Global')) ->required(), // Forms\Components\TextInput::make('phone_number') // ->tel(), @@ -45,27 +49,35 @@ public static function table(Table $table): Table return $table ->columns([ Tables\Columns\TextColumn::make('email') + ->label(__('Email')) ->searchable(), Tables\Columns\TextColumn::make('verify_code') + ->label(__('Verify code')) ->fontFamily('mono') ->searchable(), Tables\Columns\IconColumn::make('global') + ->label(__('Global')) ->boolean(), Tables\Columns\TextColumn::make('phone_number') + ->label(__('Phone number')) ->searchable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('slack_webhook_url') + ->label(__('Slack Webhook URL')) ->searchable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('verified_at') + ->label(__('Verified at')) ->dateTime() ->sortable() ->toggleable(), Tables\Columns\TextColumn::make('created_at') + ->label(__('Created at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), Tables\Columns\TextColumn::make('updated_at') + ->label(__('Updated at')) ->dateTime() ->sortable() ->toggleable(isToggledHiddenByDefault: true), @@ -105,6 +117,11 @@ public static function getPages(): array } public static function getLabel(): ?string + { + return __('Subscriber'); + } + + public static function getPluralLabel(): ?string { return __('Subscribers'); } diff --git a/src/Filament/Widgets/Overview.php b/src/Filament/Widgets/Overview.php index 591ed9c9..8d114dcb 100644 --- a/src/Filament/Widgets/Overview.php +++ b/src/Filament/Widgets/Overview.php @@ -19,21 +19,21 @@ protected function getColumns(): int protected function getStats(): array { return [ - Stat::make('Total Incidents', Incident::count()) + Stat::make(__('Total Incidents'), Incident::count()) ->description(__('Total number of reported incidents.')) ->chart(DB::table('incidents')->selectRaw('count(*) as total')->groupByRaw('date(created_at)')->get()->pluck('total')->toArray()) ->icon('cachet-incident') ->chartColor('info') ->color('gray'), - Stat::make('Metric Points', MetricPoint::count()) + Stat::make(__('Metric Points'), MetricPoint::count()) ->description(__('Recent metric points.')) ->chart(DB::table('metric_points')->selectRaw('count(*) as total')->groupBy('created_at')->get()->pluck('total')->toArray()) ->icon('cachet-metrics') ->chartColor('info') ->color('gray'), - Stat::make('Total Subscribers', Subscriber::count()) + Stat::make(__('Total Subscribers'), Subscriber::count()) ->description(__('Total number of subscribers.')) ->chart(DB::table('subscribers')->selectRaw('count(*) as total')->groupByRaw('date(created_at)')->get()->pluck('total')->toArray()) ->icon('cachet-subscribers')