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>
34 lines
1.2 KiB
PHP
34 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Tenant\Resources\OnlineOrderResource\RelationManagers;
|
|
|
|
use Filament\Resources\RelationManagers\RelationManager;
|
|
use Filament\Tables;
|
|
use Filament\Tables\Table;
|
|
|
|
class ItemsRelationManager extends RelationManager
|
|
{
|
|
protected static string $relationship = 'items';
|
|
|
|
protected static ?string $title = null;
|
|
|
|
public static function getTitle(\Illuminate\Database\Eloquent\Model $ownerRecord, string $pageClass): string
|
|
{
|
|
return __('Produse');
|
|
}
|
|
|
|
public function table(Table $table): Table
|
|
{
|
|
return $table
|
|
->recordTitleAttribute('name')
|
|
->columns([
|
|
Tables\Columns\TextColumn::make('name')->label(__('Piesă'))->wrap(),
|
|
Tables\Columns\TextColumn::make('article')->label(__('Cod'))->placeholder('—'),
|
|
Tables\Columns\TextColumn::make('qty')->label(__('Cant.'))->alignRight(),
|
|
Tables\Columns\TextColumn::make('price')->label(__('Preț'))->money('MDL')->alignRight(),
|
|
Tables\Columns\TextColumn::make('total')->money('MDL')->alignRight(),
|
|
Tables\Columns\IconColumn::make('fulfilled')->label(__('Onorat'))->boolean(),
|
|
]);
|
|
}
|
|
}
|