Add SerialValidation model with fillable attributes and relationships
This commit is contained in:
47
app/Models/SerialValidation.php
Normal file
47
app/Models/SerialValidation.php
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
|
class SerialValidation extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
use SoftDeletes;
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'sticker_master_id',
|
||||||
|
'plant_id',
|
||||||
|
'invoice_number',
|
||||||
|
'serial_number',
|
||||||
|
'motor_scanned_status',
|
||||||
|
'pump_scanned_status',
|
||||||
|
'capacitor_scanned_status',
|
||||||
|
'scanned_status_set',
|
||||||
|
'scanned_status',
|
||||||
|
'panel_box_supplier',
|
||||||
|
'panel_box_serial_number',
|
||||||
|
'load_rate',
|
||||||
|
'upload_status',
|
||||||
|
'batch_number',
|
||||||
|
'quantity',
|
||||||
|
'operator_id',
|
||||||
|
];
|
||||||
|
|
||||||
|
public function plant(): BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Plant::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stickerMaster(): BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(StickerMaster::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stickerMasterRelation()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(StickerMaster::class, 'sticker_master_id');
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user