Skip to content

Feature/enhanced column usage#24

Merged
AlexVanSteenhoven merged 8 commits intomainfrom
feature/enhanced-column-usage
Jul 9, 2025
Merged

Feature/enhanced column usage#24
AlexVanSteenhoven merged 8 commits intomainfrom
feature/enhanced-column-usage

Conversation

@AlexVanSteenhoven
Copy link
Copy Markdown
Member

  • Deprecated ->relationship() function
  • Added ->label() function
  • Tweaked: make() method to accept field (name) and label

…ctionality

- Marked the `relationship()` and `getRelationship()` methods as deprecated, advising users to use the `field()` method instead.
- Added deprecation warnings to ensure users are informed when using the deprecated methods.
- Updated the `HasColumns` and `HasSorting` traits to handle backward compatibility for deprecated relationship checks without triggering deprecation warnings.
- Adjusted the `Table` class to suppress deprecation warnings during internal compatibility checks for relationship fields.
- Updated unit tests to reflect the changes in method usage from `relationship()` to `field()`.
… and usability

- Updated the constructor to accept an optional display label, allowing for more intuitive column creation.
- Added a static `make` method for easier instantiation of Column objects.
- Introduced new methods for setting column properties, including `label`, `field`, `sortField`, `sortUsing`, `sortable`, `searchable`, `format`, `hidden`, `width`, `align`, and `view`, each with detailed documentation.
- Enhanced getter methods to provide additional information about column properties, such as `getSortField`, `getSortCallback`, and checks for sortable, searchable, and hidden states.
- Improved code readability and maintainability by adding comprehensive PHPDoc comments for all new and modified methods.
…and functionality

- Introduced comprehensive tests for the Column class, covering various scenarios including constructor behavior, method chaining, and value extraction.
- Added tests for the TextColumn class, validating enhanced usage with field and label parameters, method chaining, and value extraction.
- Ensured backward compatibility for existing methods while testing new features.
- Improved overall test coverage for both classes, contributing to better maintainability and reliability of the codebase.
- Increased memory limit for PHPStan analysis to 1G to accommodate larger codebases and prevent memory exhaustion during static analysis.
- Removed outdated and unnecessary entries from the PHPStan baseline configuration, streamlining the file and improving clarity for future maintenance.
- Added a div with overflow-x-auto around the table to enhance responsiveness and prevent overflow issues on smaller screens.
- Ensured that the table structure remains intact while improving the overall user experience on various devices.
…stency and clarity

- Updated PHPDoc comments across the Column class and HasColumns and HasSorting traits to ensure consistent formatting and improved readability.
- Enhanced parameter descriptions to include type hints and clarify their purpose, contributing to better documentation and maintainability.
- Removed deprecated error suppression logic in favor of clearer relationship checks, improving code quality and clarity.
- Simplified the check for attribute filtering in the HasFilters trait by removing unnecessary method_exists calls.
- Enhanced PHPDoc comments across various filter classes and traits to include return type hints and clarify method purposes, improving documentation quality.
- Updated the getVisibleRowIds method in HasRowSelection to handle different row types more robustly, ensuring compatibility with both Collection and LengthAwarePaginator.
- Improved the getRows method in the Table class to specify the return type more accurately, enhancing type safety and clarity.
- Refined the logic for searching relationships in the applySearchToRelationship method, ensuring clearer handling of dot notation in field names.
…dability

- Updated anonymous class syntax in unit tests for Column and TextColumn to enhance code clarity and consistency.
- Adjusted spacing in lambda functions for badge rendering to align with coding standards.
- Improved overall structure of test cases to maintain readability and maintainability.
@AlexVanSteenhoven AlexVanSteenhoven merged commit 06772b0 into main Jul 9, 2025
20 of 21 checks passed
@AlexVanSteenhoven AlexVanSteenhoven deleted the feature/enhanced-column-usage branch July 9, 2025 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant