This trait will allow you to get defined relationships on the model. I wish Laravel have a way to get this without any additions(except for trait), but there is no way.
Here we have 2 versions of the trait: for PHP7 and for PHP5.
Both method uses Reflections to collect information about the model.
With PHP7 version you'll only need to add return class for the relationship method like this: