value; protected static ?int $navigationSort = 4; protected static ?string $modelLabel = 'Hợp đồng'; protected static ?string $pluralModelLabel = 'Hợp đồng'; public static function form(Schema $schema): Schema { return $schema ->components([ Section::make('Liên kết & Mẫu thanh toán') ->columns(2) ->schema([ Select::make('product_id')->label('Sản phẩm')->relationship('product', 'code')->required()->live(), Select::make('payment_template_id')->label('Mẫu thanh toán') ->options(fn (Get $get) => PaymentTemplate::pluck('name', 'id')) ->required()->dehydrated(false), Select::make('customers')->label('Khách hàng')->relationship('customers', 'full_name')->multiple()->required()->columnSpanFull(), ]), Section::make('Chi tiết Hợp đồng') ->columns(2) ->schema([ TextInput::make('contract_number')->label('Số HĐ')->required(), DatePicker::make('signing_date')->label('Ngày ký')->required(), ]) ]); } public static function table(Table $table): Table { return $table ->columns([ Tables\Columns\TextColumn::make('contract_number')->label('Số HĐ')->searchable(), Tables\Columns\TextColumn::make('product.code')->label('Sản phẩm'), Tables\Columns\TextColumn::make('total_value')->label('Giá trị')->money('VND'), ]); } public static function getRelations(): array { return [ScheduleItemsRelationManager::class]; } public static function getPages(): array { return [ 'index' => Pages\ListContracts::route('/'), 'create' => Pages\CreateContract::route('/create'), 'edit' => Pages\EditContract::route('/{record}/edit'), ]; } }