Browse Source

Update Report model

Daniel Supernault 6 years ago
parent
commit
9f29ab9338
1 changed files with 9 additions and 8 deletions
  1. 9 8
      app/Report.php

+ 9 - 8
app/Report.php

@@ -22,14 +22,15 @@ class Report extends Model
     {
         $class = $this->object_type;
         switch ($class) {
-        case 'App\Status':
-         $column = 'id';
-          break;
-
-        default:
-         $column = 'id';
-          break;
-      }
+            case 'App\Status':
+             $column = 'id';
+              break;
+
+            default:
+             $class = 'App\Status';
+             $column = 'id';
+              break;
+        }
 
         return (new $class())->where($column, $this->object_id)->firstOrFail();
     }