Initial commit for combined ProjectKP
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Models\Pegawai;
|
||||
|
||||
class UnitKerja extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'unit_kerja'; // sesuaikan dengan nama tabel di migration
|
||||
|
||||
protected $fillable = [
|
||||
'nama_unit'
|
||||
];
|
||||
|
||||
// 🔗 Relasi: 1 unit kerja punya banyak pegawai
|
||||
public function pegawai()
|
||||
{
|
||||
return $this->hasMany(Pegawai::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user