2022-06-01 07:15:55 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models\Auth;
|
|
|
|
|
|
|
|
|
|
use App\Abstracts\Model;
|
|
|
|
|
|
|
|
|
|
class UserInvitation extends Model
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* The table associated with the model.
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
protected $table = 'user_invitations';
|
|
|
|
|
|
|
|
|
|
protected $tenantable = false;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The attributes that are mass assignable.
|
|
|
|
|
*
|
|
|
|
|
* @var string[]
|
|
|
|
|
*/
|
2023-07-05 09:16:25 +00:00
|
|
|
protected $fillable = ['user_id', 'token', 'created_from', 'created_by'];
|
2022-06-01 07:15:55 +00:00
|
|
|
|
|
|
|
|
public function user()
|
|
|
|
|
{
|
2023-10-03 08:06:08 +00:00
|
|
|
return $this->belongsTo(user_model_class());
|
2022-06-01 07:15:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Scope a query to only include given token value.
|
|
|
|
|
*
|
|
|
|
|
* @param \Illuminate\Database\Eloquent\Builder $query
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function scopeToken($query, $token)
|
|
|
|
|
{
|
|
|
|
|
$query->where('token', $token);
|
|
|
|
|
}
|
|
|
|
|
}
|