mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Add new methods to Profile model
This commit is contained in:
parent
36b0bfb19a
commit
fe70cd1eca
1 changed files with 10 additions and 0 deletions
|
@ -6,6 +6,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class Profile extends Model
|
class Profile extends Model
|
||||||
{
|
{
|
||||||
|
public function url()
|
||||||
|
{
|
||||||
|
return url('/' . $this->username);
|
||||||
|
}
|
||||||
|
|
||||||
public function statuses()
|
public function statuses()
|
||||||
{
|
{
|
||||||
return $this->hasMany(Status::class);
|
return $this->hasMany(Status::class);
|
||||||
|
@ -34,4 +39,9 @@ class Profile extends Model
|
||||||
'id'
|
'id'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function likes()
|
||||||
|
{
|
||||||
|
return $this->hasMany(Like::class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue