|
|
@ -29,6 +29,15 @@ class Profile extends Model
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function url($suffix = '')
|
|
|
|
public function url($suffix = '')
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if($this->remote_url) {
|
|
|
|
|
|
|
|
return $this->remote_url;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return url($this->username . $suffix);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function localUrl($suffix = '')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return url($this->username . $suffix);
|
|
|
|
return url($this->username . $suffix);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -124,4 +133,9 @@ class Profile extends Model
|
|
|
|
$url = url(Storage::url($this->avatar->media_path ?? 'public/avatars/default.png'));
|
|
|
|
$url = url(Storage::url($this->avatar->media_path ?? 'public/avatars/default.png'));
|
|
|
|
return $url;
|
|
|
|
return $url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function statusCount()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return $this->statuses()->whereHas('media')->count();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|