Skip to content

fix: make record URL resolvers config-cache safe#2567

Open
RaBic wants to merge 2 commits into
lunarphp:2.xfrom
RaBic:agent/fix-record-url-config-cache
Open

fix: make record URL resolvers config-cache safe#2567
RaBic wants to merge 2 commits into
lunarphp:2.xfrom
RaBic:agent/fix-record-url-config-cache

Conversation

@RaBic

@RaBic RaBic commented Jul 17, 2026

Copy link
Copy Markdown

Summary

  • Replace the Lunar Admin record URL closures with serializable static callable arrays.
  • Move the unchanged URL construction into RecordUrlResolvers.
  • Add regression coverage for all three provider registrations.

Why

LunarPanelProvider writes closures into Laravel configuration at boot. Laravel cannot reconstruct those values while caching configuration, so php artisan config:cache and php artisan optimize fail.

The callable arrays preserve all existing order, product-variant, and collection URL behaviour while allowing Laravel to export and reload configuration.

Fixes #2564.

Verification

  • vendor/bin/pest tests/admin/Unit/LunarPanelProviderTest.php
  • vendor/bin/pest --testsuite=admin (236 passed, 793 assertions)
  • vendor/bin/pint --dirty --format agent
  • vendor/bin/phpstan analyse packages/admin/src tests/admin/Unit/LunarPanelProviderTest.php --memory-limit=1G

@RaBic
RaBic marked this pull request as ready for review July 17, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant