<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Kecamatan extends Model
{
use HasFactory;
protected $fillable = [
'id',
'kabupaten_kota_id',
'nama'
];
// Custom primary key column name
protected $primaryKey = 'id';
// If primary key is not auto-incrementing
public $incrementing = false;
// If primary key is a non-integer type (like string or UUID)
protected $keyType = 'string';
public function kabupaten_kota(){
return $this->belongsTo(KabupatenKota::class,'kabupaten_kota_id','id');
}
}
Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]