forked from admin/services_core
31 lines
511 B
PHP
31 lines
511 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class UserTenant extends Model
|
|
{
|
|
protected $table = 'user_tenants';
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'tenant_id',
|
|
'is_default',
|
|
];
|
|
|
|
protected $casts = [
|
|
'is_default' => 'boolean',
|
|
];
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
|
|
public function tenant()
|
|
{
|
|
return $this->belongsTo(Tenant::class, 'tenant_id');
|
|
}
|
|
}
|