Update Report model

This commit is contained in:
Daniel Supernault 2018-11-03 21:25:26 -06:00
parent 7492194cc2
commit 9f29ab9338
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

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