Add new methods to Profile model

This commit is contained in:
Daniel Supernault 2018-04-18 23:57:16 -06:00
parent 36b0bfb19a
commit fe70cd1eca

View file

@ -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);
}
} }