What are traits in Laravel?
PHP Traits are simply a group of methods that you want include within another class. A Trait, like an abstract class cannot be instantiated by itself.Trait are created to reduce the limitations of single inheritance in PHP by enabling a developer to reuse sets of methods freely in several independent classes living in different class hierarchies.
Here is an example of trait.
You could then include this Trait within other classes like this:
Now if you were to create new objects out of these classes you would find that they both have the share() method available: