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

Change boot methods to match Eloquent boot[traitName] pattern. #2

Merged
merged 1 commit into from
Jun 9, 2016
Merged

Change boot methods to match Eloquent boot[traitName] pattern. #2

merged 1 commit into from
Jun 9, 2016

Conversation

KKSzymanowski
Copy link
Collaborator

Because methods of traits used by the one class cannot have the same name there is a chance that(especially in User model) when using some other trait, it also implements boot method.

To avoid that I changed all boot methods to match Laravel Eloquent boot[traitName] pattern.
It is automatically resolved so it acts exactly like a boot method. Also, you don't need to call parent::boot(actually you mustn't because it will crash everything) and most importantly it keeps you safe from method name conflicts.

I think this issue was raised in Zizaco/Entrust package but never addressed, so I'm doing this here.

I also added composer.lock file to .gitignore because who needs it.

Really looking forward to working with your fork.

@Mathius17
Copy link
Contributor

Thanks for your contribution @KKSzymanowski! It seems ok to me. I'll merge your PR

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