fix : 테이블 추가 및 수정
- 신규 (user_roles, user_tenants) - 수정 (roles, tenants, users)
This commit is contained in:
31
app/Models/UserRole.php
Normal file
31
app/Models/UserRole.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user