Files
api_arrahn/app/Poskod.php
T
2023-03-16 16:38:08 +08:00

41 lines
815 B
PHP

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class Poskod extends Model
{
protected $table = 'poskod';
protected $primaryKey = 'recno';
public $timestamps = false;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'poskod',
'koddaerah',
'kodnegeri',
];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
// protected $hidden = [];
public function negeri(): BelongsTo {
return $this->belongsTo(Negeri::class, 'kodnegeri', 'kodnegeri');
}
public function daerah(): BelongsTo {
return $this->belongsTo(Daerah::class, 'koddaerah', 'koddaerah');
}
}