Added guard_patrol_entry model file
This commit is contained in:
39
app/Models/GuardPatrolEntry.php
Normal file
39
app/Models/GuardPatrolEntry.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class GuardPatrolEntry extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'plant_id',
|
||||
'guard_name_id',
|
||||
'check_point_name_id',
|
||||
'reader_code',
|
||||
'patrol_time',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
];
|
||||
|
||||
public function plant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Plant::class);
|
||||
}
|
||||
|
||||
public function guardNames(): BelongsTo
|
||||
{
|
||||
//return $this->belongsTo(CheckPointName::class);
|
||||
return $this->belongsTo(GuardName::class, 'guard_name_id');
|
||||
}
|
||||
|
||||
public function checkPointNames(): BelongsTo
|
||||
{
|
||||
//return $this->belongsTo(CheckPointName::class);
|
||||
return $this->belongsTo(CheckPointName::class, 'check_point_name_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user