Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helper function to get model morph name #1947

Merged
merged 3 commits into from
Sep 17, 2024
Merged

Conversation

wychoong
Copy link
Contributor

to simplify the usage of getting relationship alias

// before
(new Collection)->getMorphClass()

// after
Collection::morphName()

Copy link

vercel bot commented Sep 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lunar-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 13, 2024 9:36am

@alecritson
Copy link
Collaborator

I think this is good to have we'd just need to update the existing codebase so it's consistent.

@wychoong
Copy link
Contributor Author

I think this is good to have we'd just need to update the existing codebase so it's consistent.

done. I only changed those using (new Model)->getMorphClass, those already have the instance i remain $record->getMorphClass()

added test as well.

@alecritson alecritson self-requested a review September 17, 2024 08:26
@alecritson alecritson merged commit 9eac4c7 into lunarphp:1.x Sep 17, 2024
22 checks passed
@wychoong wychoong deleted the patch-1 branch September 17, 2024 08:42
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.

2 participants