Update Status model

This commit is contained in:
Daniel Supernault 2018-12-23 19:07:49 -07:00
parent b86eb83cc0
commit a6b7898d98
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -19,7 +19,7 @@ class Status extends Model
*/
protected $dates = ['deleted_at'];
protected $fillable = ['profile_id', 'visibility', 'in_reply_to_id', 'reblog_of_id'];
protected $fillable = ['profile_id', 'visibility', 'in_reply_to_id', 'reblog_of_id', 'type'];
const STATUS_TYPES = [
'text',
@ -90,13 +90,13 @@ class Status extends Model
public function url()
{
if($this->url) {
return $this->url;
if($this->uri) {
return $this->uri;
}
$id = $this->id;
$username = $this->profile->username;
$path = config('app.url')."/p/{$username}/{$id}";
return url($path);
$path = url(config('app.url')."/p/{$username}/{$id}");
return $path;
}
public function permalink($suffix = '/activity')