-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
[9.x] Include Eloquent Model Observers in model:show command #43470
Conversation
I kinda want to let this command settle a bit before I start adding much more stuff to it. Let's circle back to this in a few weeks. |
Hey @taylorotwell, what's the feeling like now with the Given the command tells us most other things about a model I think including observers would fit its purpose pretty well. They can also be less discoverable as you can't always see that observers exist by looking at the model file. |
Hey @taylorotwell, just bumping this now that |
Any thoughts on this @timacdonald? I know Model Observers aren't used that often, but IMO that's a good reason to display them. Might make debugging an issue easier if a maintainer wasn't considering them. |
I'm keen on this feature and think it makes a lot of sense! |
@@ -339,6 +376,17 @@ protected function displayCli($class, $database, $table, $attributes, $relations | |||
|
|||
$this->newLine(); | |||
|
|||
$this->components->twoColumnDetail('<fg=green;options=bold>Eloquent Observers</>'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably just make this "Observers". I'm also thinking it should go beneath "Relations"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Jess. I've made those changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jessarcher Ahoy hoy. Any more to do on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mike-healy I don't see changes. Do they not show because it's closed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jessarcher I think that might be it.
I made that change in a29981, but it didn't seem to update the PR.
This PR builds on the new
artisan model:show
command to also list Model Observers. They could be handy to see on the Model information as it's not always obvious that a Model is being observed.It handles cases where multiple observers are attached to an action.