-
-
Save grafxflow/480331ac5a73ae491550c1b2d77082e9 to your computer and use it in GitHub Desktop.
get class model name of object #laravel #php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| get_class($obj) // App\Models\Foo | |
| class_basename($obj) // Foo | |
| (new ReflectionClass($obj))->getShortName() // Foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment