check variable type in laravel

PHP
gettype($u)
Source

Also in PHP: