Use the model_name to both check for a class and retrieve it

This commit is contained in:
Kevin MacMartin 2019-11-18 16:01:36 -05:00
parent b54ad4ba28
commit 54843cbdf2

View file

@ -73,7 +73,7 @@ class Dashboard
$model_name = ucfirst($model);
if (file_exists(app_path() . '/Models/' . $model_name . '.php')) {
$model_class = 'App\\Models\\' . ucfirst($model);
$model_class = 'App\\Models\\' . $model_name;
if ($type != null && $type != $model_class::$dashboard_type) {
return null;