39 lines
685 B
PHP
39 lines
685 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class GroupPerusahaan extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'GroupPerusahaan';
|
|
|
|
protected $primaryKey = 'GroupPerusahaanId';
|
|
|
|
|
|
protected $fillable = [
|
|
'UserId',
|
|
'PermissionId',
|
|
];
|
|
|
|
/**
|
|
* Relasi ke model User.
|
|
*/
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class, 'UserId', 'id');
|
|
}
|
|
|
|
|
|
/**
|
|
* Relasi ke model Perusahaan.
|
|
*/
|
|
public function perusahaan()
|
|
{
|
|
return $this->hasMany(Perusahaan::class, 'PerusahaanId', 'PerusahaanId');
|
|
}
|
|
}
|