f7fc69077b
- Convert static $modelLabel/$pluralModelLabel/$title to getter methods - Wrap ->label()/->placeholder()/->helperText()/->description()/->title()/->body() args - Wrap Section::make()/Fieldset::make()/Notification::make()->title() args - Fix RelationManagers::getTitle() signature to match parent (Model, string) - Fix Pages::getTitle() to instance method (BasePage::getTitle is non-static) - Extend lang/ru.json + lang/en.json with 700+ common terms; identity fallback for the rest - Remove duplicate getters in 5 resources that had manual getModelLabel already All 306 tests pass. Missing translations fall back to the RO key so the UI never breaks. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
42 lines
1.5 KiB
PHP
42 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Central\Widgets;
|
|
|
|
use App\Filament\Central\Resources\CompanyResource;
|
|
use App\Models\Central\Company;
|
|
use Filament\Tables;
|
|
use Filament\Tables\Table;
|
|
use Filament\Widgets\TableWidget as BaseWidget;
|
|
|
|
class RecentTenants extends BaseWidget
|
|
{
|
|
protected static ?int $sort = 3;
|
|
|
|
protected int|string|array $columnSpan = 'full';
|
|
|
|
public function table(Table $table): Table
|
|
{
|
|
return $table
|
|
->heading(__('Tenants recenți'))
|
|
->query(Company::query()->latest()->limit(8))
|
|
->columns([
|
|
Tables\Columns\TextColumn::make('slug')
|
|
->copyable()
|
|
->url(fn (Company $record) => CompanyResource::getUrl('view', ['record' => $record])),
|
|
Tables\Columns\TextColumn::make('name')->weight('bold'),
|
|
Tables\Columns\TextColumn::make('status')
|
|
->badge()
|
|
->color(fn ($s) => match ($s) {
|
|
'active' => 'success',
|
|
'trial' => 'warning',
|
|
'suspended', 'expired' => 'danger',
|
|
default => 'gray',
|
|
}),
|
|
Tables\Columns\TextColumn::make('plan.name')->placeholder('—'),
|
|
Tables\Columns\TextColumn::make('users_count')->counts('users')->label(__('Useri')),
|
|
Tables\Columns\TextColumn::make('created_at')->label(__('Creat'))->since(),
|
|
])
|
|
->paginated(false);
|
|
}
|
|
}
|