Check if a class is a Model in Laravel 5
<p>I have this code in Laravel 5.2 that checks if a given db table name ($what) has its own Model :</p>

<pre><code>public function manage($what) {

    $model = Str::studly(Str::singular($what));
    if (!is_subclass_of($model, 'Model')) {
        \App::abort(404);
    }

    /* [... other stuff ...] */
}
</code></pre>

<p>The problem is that is_subclass_of always fail, also when the model exist and it's a subclass of Model. I suppose it's a namespace problem, how can I fix it?</p>