Laravel otrzymuj nazwę klasy
$myObject = $em->find(ContactRelation::class, $userId);
echo get_class($myObject);
// Some\Name\Space\Domain\Identity\ContactRelation
SmokeFrog
$myObject = $em->find(ContactRelation::class, $userId);
echo get_class($myObject);
// Some\Name\Space\Domain\Identity\ContactRelation
// laravel helper:
$baseClass = class_basename(App\Models\User::class);
// User