first commit
This commit is contained in:
46
app/Models/DataCentreConsultantAssignment.php
Normal file
46
app/Models/DataCentreConsultantAssignment.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class DataCentreConsultantAssignment extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'data_centre_id',
|
||||
'consultant_id',
|
||||
'start_date',
|
||||
'end_date',
|
||||
'reason',
|
||||
'assigned_by',
|
||||
'is_active',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'start_date' => 'date',
|
||||
'end_date' => 'date',
|
||||
'is_active' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function dataCentre(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(DataCentre::class);
|
||||
}
|
||||
|
||||
public function consultant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Consultant::class);
|
||||
}
|
||||
|
||||
public function assignedBy(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'assigned_by');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user