check type in laravel

PHP
gettype($u)
Source

Also in PHP: