akaunting/app/Models/Auth/UserInvitation.php
2022-06-01 10:15:55 +03:00

41 lines
778 B
PHP

<?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[]
*/
protected $fillable = ['user_id', 'company_id', 'token'];
public function user()
{
return $this->belongsTo('App\Models\Auth\User');
}
/**
* 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);
}
}