Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When Laravel Telescope records an entry for a Job/Event/Exception, it automatically associates the record with tags for all the Eloquent models included in the object. These tags can then be monitored, making it easy to filter records related to one specific model. This doesn't work for Actions, since the included models are dynamic attributes and not hard-coded properties. Adding this trait to an Action fixes that, since Telescope will call the object's `tags` method if one exists. This is just a proof of concept, since I'm a new Telescope user. I just thought it might be useful to others. It *should* identify every model present in the attributes, whether they're single models, arrays or collections. If the models have any relationships loaded, their tags are also included recursively (I'm not sure if this is a wise decision - I just did it because it was fun). Let me know if you're interested in this addition. I'm very open to suggestions, and it obviously also needs to be tested.
- Loading branch information