check type of variable laravel

PHP
gettype($u)
Source

Also in PHP: