<?php

namespace App\Models\Auth;

use Illuminate\Database\Eloquent\Model;

class Invite extends Model
{
    /**
     * Don't auto-apply mass assignment protection.
     *
     * @var array
     */
    protected $guarded = [];

    // I like to explicitly define tables
    protected $table = 'invites';

    protected $fillable = [
        'email', 'token','created_by', 'notified', 'notification_id'
    ];

    public function user()
    {
        return $this->hasOne('App\Models\Auth\User', 'id', 'created_by');
    }

    public function messagethread()
    {
        return $this->hasOne('App\Models\Messages\ExtendedThread', 'id', 'notification_id');
    }
}
