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

Support multiple boot using callbacks #13220

Merged
merged 2 commits into from
Jun 13, 2024

Conversation

ralphjsmit
Copy link
Contributor

Description

I generally use the bootUsing() function quite often to provide a callback. One technique is use is to have an abstract base PanelProvider class and the actual panel provider extend this abstract class. That way, panel configuration can be applied to multiple panels at once. Currently, if I provide a bootUsing() in both the abstract base class and the actual panel provider that extends this, the bootUsing() callback provided first will be overwritten by later calls. I remember seing a PR about this earlier, but I couldn't find it, so it could've imagined it. Another risk relating to this is when registering plugins, they also get access to the $panel object and could (at any time) provide a custom bootUsing(), which could then overwrite the developer's bootUsing() from the panel provider class. I therefore thing it would be useful to store the callbacks as an array and call them one by one, in order to prevent such over-writing issues (and also make it safe for plugins to use bootUsing()).

Thanks!

Functional changes

  • Code style has been fixed by running the composer cs command.
  • Changes have been tested to not break existing functionality.
  • Documentation is up-to-date.

@danharrin danharrin added the enhancement New feature or request label Jun 13, 2024
@danharrin danharrin added this to the v3 milestone Jun 13, 2024
@danharrin danharrin merged commit 4d02a70 into filamentphp:3.x Jun 13, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants