laravel get class name of object code example
Example 1: laravel get class name
$myObject = $em->find(ContactRelation::class, $userId);
echo get_class($myObject);
// Some\Name\Space\Domain\Identity\ContactRelation
Example 2: class name laravel
// laravel helper:
$baseClass = class_basename(App\Models\User::class);
// User