perling/app/Models/Perusahaan.php

27 lines
535 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Perusahaan extends Model
{
protected $table = 'Perusahaan';
protected $primaryKey = 'PerusahaanID';
protected $fillable = [
'NamaPerusahaan',
'Alamat',
];
public function jadwalSidang()
{
return $this->hasMany(JadwalSidang::class, 'PerusahaanID', 'PerusahaanID');
}
public function users()
{
return $this->belongsToMany(User::class, 'Perusahaan_User', 'PerusahaanID', 'UserID');
}
}