75 lines
1.7 KiB
PHP
75 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Database\Factories\PusatMengundiFactory;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class PusatMengundi extends Model
|
|
{
|
|
/** @use HasFactory<PusatMengundiFactory> */
|
|
use HasFactory, SoftDeletes;
|
|
|
|
protected $guarded = [];
|
|
|
|
public function election(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Election::class);
|
|
}
|
|
|
|
public function dun(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Dun::class);
|
|
}
|
|
|
|
public function daerahMengundi(): BelongsTo
|
|
{
|
|
return $this->belongsTo(DaerahMengundi::class);
|
|
}
|
|
|
|
public function saluranMengundis(): HasMany
|
|
{
|
|
return $this->hasMany(SaluranMengundi::class);
|
|
}
|
|
|
|
public function positionQuotas(): HasMany
|
|
{
|
|
return $this->hasMany(PositionQuota::class);
|
|
}
|
|
|
|
public function applications(): HasMany
|
|
{
|
|
return $this->hasMany(Application::class);
|
|
}
|
|
|
|
public function policeEscorts(): HasMany
|
|
{
|
|
return $this->hasMany(PoliceEscort::class);
|
|
}
|
|
|
|
public function kkmRepresentatives(): HasMany
|
|
{
|
|
return $this->hasMany(KkmRepresentative::class);
|
|
}
|
|
|
|
public function jkmRepresentatives(): HasMany
|
|
{
|
|
return $this->hasMany(JkmRepresentative::class);
|
|
}
|
|
|
|
public function staffAssignments(): HasMany
|
|
{
|
|
return $this->hasMany(StaffAssignment::class);
|
|
}
|
|
|
|
public function wheelchairAllocation(): HasOne
|
|
{
|
|
return $this->hasOne(WheelchairAllocation::class);
|
|
}
|
|
}
|