From 591a1929287396b5ad4677276d0fd66d5a0b0268 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 26 Apr 2020 23:25:35 -0600 Subject: [PATCH] Update UserInvite model, add sender relation --- app/UserInvite.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/UserInvite.php b/app/UserInvite.php index c8761a775..6b9a839f9 100644 --- a/app/UserInvite.php +++ b/app/UserInvite.php @@ -6,10 +6,13 @@ use Illuminate\Database\Eloquent\Model; class UserInvite extends Model { + public function sender() + { + return $this->belongsTo(Profile::class, 'profile_id'); + } + public function url() { - $path = '/i/invite/code'; - $url = url($path, [$this->key, $this->token]); - return $url; + return url("/i/invite/code/{$this->key}/{$this->token}"); } }