This update allows for using a method on individual Spotlight Command components for any custom logic that should be used to determine whether the component should be shown in the Spotlight component. I went down this path primarily due to the fact that the authenticated user isn't available in the service providers.
I'm not in love with the method name. Originally I was using shouldRegister, but that's not really what's happening since the command component is registered, but is being filtered out before it's sent to the Livewire component. I settled on shouldBeShown since "shown" is the language that's used in some of the docblocks. If there's a better method name you can think of, I'm happy to change this.
This update allows for using a method on individual Spotlight Command components for any custom logic that should be used to determine whether the component should be shown in the Spotlight component. I went down this path primarily due to the fact that the authenticated user isn't available in the service providers.
I'm not in love with the method name. Originally I was using
shouldRegister
, but that's not really what's happening since the command component is registered, but is being filtered out before it's sent to the Livewire component. I settled onshouldBeShown
since "shown" is the language that's used in some of the docblocks. If there's a better method name you can think of, I'm happy to change this.