enhancement: use proper method name when setting a foreign-key relationship#2286
enhancement: use proper method name when setting a foreign-key relationship#2286alecritson merged 1 commit intolunarphp:1.xfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughSingle-file change updating a method call in LunarServiceProvider::registerBlueprintMacros. In the userForeignKey macro, when users_id_type is 'uuid', the call is corrected to foreignUuid(...). Other logic and branches remain unchanged. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/core/src/LunarServiceProvider.php (1)
412-415: Use configured users table consistently in the int branchThe uuid and bigint branches respect the configured users model/table, but the int branch hard-codes
'users'. Suggest aligning it to honorauth.providers.users.modeltoo.Apply:
- } elseif ($type == 'int') { - $this->unsignedInteger($field_name)->nullable($nullable); - $this->foreign($field_name)->references('id')->on('users'); + } elseif ($type == 'int') { + $this->unsignedInteger($field_name)->nullable($nullable); + $this->foreign($field_name)->references('id')->on((new $userModel)->getTable());
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/core/src/LunarServiceProvider.php(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
- GitHub Check: stripe - PHP 8.4 - L12.* ↑ E
- GitHub Check: shipping - PHP 8.4 - L12.* ↑
- GitHub Check: core - PHP 8.4 - L12.* ↑
- GitHub Check: admin - PHP 8.4 - L12.* ↑
- GitHub Check: shipping - PHP 8.4 - L12.* ↑ E
- GitHub Check: search - PHP 8.3 - L12.* ↑
- GitHub Check: core - PHP 8.4 - L12.* ↑ E
- GitHub Check: core - PHP 8.4 - L11.* ↑
- GitHub Check: admin - PHP 8.3 - L12.* ↑
- GitHub Check: admin - PHP 8.4 - L11.* ↑
- GitHub Check: admin - PHP 8.4 - L11.* ↑ E
- GitHub Check: core - PHP 8.4 - L11.* ↑ E
- GitHub Check: core - PHP 8.3 - L11.* ↑ E
- GitHub Check: admin - PHP 8.3 - L12.* ↑ E
- GitHub Check: core - PHP 8.3 - L12.* ↑
- GitHub Check: core - PHP 8.3 - L12.* ↑ E
- GitHub Check: admin - PHP 8.3 - L11.* ↑ E
- GitHub Check: admin - PHP 8.3 - L11.* ↑
- GitHub Check: core - PHP 8.3 - L11.* ↑
🔇 Additional comments (1)
packages/core/src/LunarServiceProvider.php (1)
406-412: foreignUuid casing and version constraint validatedSwitching to
$this->foreignUuid()aligns perfectly with Laravel’s Blueprint API. I’ve confirmed:
- The root and
packages/core/composer.jsonboth require"laravel/framework": "^11.0|^12.0", which includes theforeignUuidmethod.- A codebase-wide regex search found no remaining mis-cased calls (
foreignUuId,foreignUUId,foreignuUid, etc.).All set to approve these changes.
The code being replaced worked because PHP method names are case-insensitive for historical reasons, it's better to use proper name of the method.
Summary by CodeRabbit