Skip to content

Fix made for Table attribute being generated with the wrong arg name#489

Merged
peterfox merged 3 commits intomainfrom
bugfix/table-attribute-name-arg
Mar 24, 2026
Merged

Fix made for Table attribute being generated with the wrong arg name#489
peterfox merged 3 commits intomainfrom
bugfix/table-attribute-name-arg

Conversation

@peterfox
Copy link
Copy Markdown
Collaborator

@peterfox peterfox commented Mar 24, 2026

Summary

This PR fixes a bug in TablePropertyToTableAttributeRector where it was using the incorrect argument name table instead of name for the Eloquent Table attribute. This aligns the Rector rule with the expected attribute structure in Laravel 13+ and the existing TableAttributeFactory.

Changes

• Rector Rule: Updated TablePropertyToTableAttributeRector to:
◦ Search for the name argument when checking existing Table attributes.
◦ Update getRuleDefinition code samples to use name: '...'.
• Tests: Updated all test fixtures in tests/Rector/Class_/TablePropertyToTableAttributeRector/Fixture to use name: '...' instead of table: '...' in the expected output (and input where applicable).

Context

Pointed out in #477

Incorrect argument name used. https://github.com/laravel/framework/blob/13.x/src/Illuminate/Database/Eloquent/Attributes/Table.php#L21

@peterfox peterfox self-assigned this Mar 24, 2026
@peterfox peterfox added the bug Something isn't working label Mar 24, 2026
@peterfox peterfox requested review from GeniJaho and calebdw March 24, 2026 15:02
@peterfox peterfox added the ai PRs that used AI either through an agent of generation label Mar 24, 2026
@peterfox peterfox changed the title Fix made Fix made for Table attribute being generated with the wrong arg name Mar 24, 2026
@peterfox peterfox merged commit b02e65a into main Mar 24, 2026
5 checks passed
@peterfox peterfox deleted the bugfix/table-attribute-name-arg branch March 24, 2026 15:44
@utqinadhif
Copy link
Copy Markdown

please make this to release version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai PRs that used AI either through an agent of generation bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants