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

[5.6] Prevent calling the bootable trait boot method twice #24556

Merged
merged 1 commit into from
Jun 12, 2018

Conversation

themsaid
Copy link
Member

The User model in Spark for example uses the Spark\Billable trait which uses the Cashier\Billable trait, in Model::bootTraits method class_uses_recursive will return the two different Billable traits in the results, so if the Billable trait has a bootBillable method it'll be called twice:

One when model::bootTrairs found Spark\Billable and one when it found Cashier\Billable.

This PR prevents calling the trait boot method multiple times by keeping track of what methods were called and prevent calling them again.

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.

None yet

2 participants