Files
sam-api/app/Models/UserRole.php

32 lines
575 B
PHP
Raw Normal View History

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Traits\BelongsToTenant;
class UserRole extends Model
{
use SoftDeletes, BelongsToTenant;
protected $fillable = [
'user_id', 'tenant_id', 'role_id', 'assigned_at'
];
public function user()
{
return $this->belongsTo(User::class);
}
public function tenant()
{
return $this->belongsTo(Tenant::class);
}
public function role()
{
return $this->belongsTo(Role::class);
}
}