Update UserInvite model, add sender relation

This commit is contained in:
Daniel Supernault 2020-04-26 23:25:35 -06:00
parent 483548e217
commit 591a192928
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -6,10 +6,13 @@ use Illuminate\Database\Eloquent\Model;
class UserInvite extends Model class UserInvite extends Model
{ {
public function sender()
{
return $this->belongsTo(Profile::class, 'profile_id');
}
public function url() public function url()
{ {
$path = '/i/invite/code'; return url("/i/invite/code/{$this->key}/{$this->token}");
$url = url($path, [$this->key, $this->token]);
return $url;
} }
} }