From fe70cd1ecadb708427602256a93a4aafcf70ee43 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 18 Apr 2018 23:57:16 -0600 Subject: [PATCH] Add new methods to Profile model --- app/Profile.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Profile.php b/app/Profile.php index aab29148..cbb2dd1f 100644 --- a/app/Profile.php +++ b/app/Profile.php @@ -6,6 +6,11 @@ use Illuminate\Database\Eloquent\Model; class Profile extends Model { + public function url() + { + return url('/' . $this->username); + } + public function statuses() { return $this->hasMany(Status::class); @@ -34,4 +39,9 @@ class Profile extends Model 'id' ); } + + public function likes() + { + return $this->hasMany(Like::class); + } }