Supported Versions: PHP 5 >= 5.4.0, PHP 7, PHP 8
Return the traits used by the given class
<?php class_uses(object|string $object_or_class, bool $autoload = true): array|false
<?php         )->useWritePdo()->get();



        if (is_a($value->class, Pivot::class, true) ||

            in_array(AsPivot::class, class_uses($value->class))) {

            return $collection;

        }
<?php     function trait_uses_recursive($trait)

    {

        $traits = class_uses($trait) ?: [];



        foreach ($traits as $trait) {

            $traits += trait_uses_recursive($trait);