first
This commit is contained in:
41
app/Models/Position.php
Normal file
41
app/Models/Position.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Database\Factories\PositionFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Position extends Model
|
||||
{
|
||||
/** @use HasFactory<PositionFactory> */
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'is_public_applyable' => 'boolean',
|
||||
'is_assignable' => 'boolean',
|
||||
'allows_dual_role' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function quotas(): HasMany
|
||||
{
|
||||
return $this->hasMany(PositionQuota::class);
|
||||
}
|
||||
|
||||
public function applications(): HasMany
|
||||
{
|
||||
return $this->hasMany(Application::class, 'requested_position_id');
|
||||
}
|
||||
|
||||
public function staffAssignments(): HasMany
|
||||
{
|
||||
return $this->hasMany(StaffAssignment::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user