Files
pds/app/Models/InvoiceValidation.php
dhanabalan 060c3e9c94
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 12s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Laravel Pint / pint (pull_request) Successful in 2m57s
Laravel Larastan / larastan (pull_request) Failing after 3m43s
Added created_at and updated_at column on model file
2026-02-26 08:50:59 +05:30

60 lines
1.4 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Prunable;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
class InvoiceValidation extends Model
{
use Prunable;
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_code',
'panel_box_supplier',
'panel_box_serial_number',
'load_rate',
'upload_status',
'batch_number',
'quantity',
'operator_id',
'created_by',
'updated_by',
'created_at',
'updated_at',
];
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');
}
public function prunable(): Builder
{
return static::where('created_at', '<=', now()->subMonthsNoOverflow(6));
}
}