If you worked with abstract objects before, you are aware of the single inheritance limitation, traits fix this in a very elegant way to allow us to write re-usable code.
Traits are created using the trait keyword:
To add a trait to a class, use the use keyword within the class:
That’s it! now you have all the trait’s methods available, to use multiple traits you can declare them on the same line separating them with a comma:
Note: traits can’t be instantiated.