Update Report model

pull/1958/head
Daniel Supernault 2020-01-22 20:05:40 -07:00
rodzic 245645abb3
commit 65be6bdd51
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0DEF1C662C9033F7
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -21,6 +21,7 @@ class Report extends Model
public function reported()
{
$class = $this->object_type;
switch ($class) {
case 'App\Status':
$column = 'id';
@ -32,7 +33,12 @@ class Report extends Model
break;
}
return (new $class())->where($column, $this->object_id)->firstOrFail();
return (new $class())->where($column, $this->object_id)->first();
}
public function status()
{
return $this->belongsTo(Status::class, 'object_id');
}
public function reportedUser()