value; protected static ?int $navigationSort = 1; protected static ?string $modelLabel = 'Mẫu thanh toán'; protected static ?string $pluralModelLabel = 'Mẫu thanh toán'; public static function form(Schema $schema): Schema { return $schema ->components([ Section::make('Thông tin mẫu') ->columns(2) ->schema([ Select::make('project_id')->label('Dự án')->relationship('project', 'name')->required(), TextInput::make('name')->label('Tên mẫu')->required(), ]), Section::make('Chi tiết đợt') ->schema([ Repeater::make('items') ->label('Danh sách đợt') ->relationship('items') ->schema([ TextInput::make('installment_no')->label('Đợt')->numeric()->required(), Select::make('type')->label('Loại')->options(PaymentType::class)->required(), TextInput::make('percentage')->label('%')->numeric()->required(), TextInput::make('days_after_signing')->label('Ngày sau ký (F0)')->numeric(), TextInput::make('days_after_previous')->label('Ngày sau đợt trước')->numeric(), \Filament\Forms\Components\DatePicker::make('due_date')->label('Ngày cố định'), ])->columns(3), ]) ]); } public static function table(Table $table): Table { return $table ->columns([ Tables\Columns\TextColumn::make('project.name')->label('Dự án'), Tables\Columns\TextColumn::make('name')->label('Tên mẫu'), ]); } public static function getPages(): array { return [ 'index' => Pages\ListPaymentTemplates::route('/'), 'create' => Pages\CreatePaymentTemplate::route('/create'), 'edit' => Pages\EditPaymentTemplate::route('/{record}/edit'), ]; } }