mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update Report model
This commit is contained in:
parent
245645abb3
commit
65be6bdd51
1 changed files with 7 additions and 1 deletions
|
@ -21,6 +21,7 @@ class Report extends Model
|
||||||
public function reported()
|
public function reported()
|
||||||
{
|
{
|
||||||
$class = $this->object_type;
|
$class = $this->object_type;
|
||||||
|
|
||||||
switch ($class) {
|
switch ($class) {
|
||||||
case 'App\Status':
|
case 'App\Status':
|
||||||
$column = 'id';
|
$column = 'id';
|
||||||
|
@ -32,7 +33,12 @@ class Report extends Model
|
||||||
break;
|
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()
|
public function reportedUser()
|
||||||
|
|
Loading…
Reference in a new issue