Add endpoint and backend for managing postcode
This commit is contained in:
@@ -3,10 +3,12 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
@@ -26,4 +28,13 @@ class Poskod extends Model
|
||||
* @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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user