Added prune logic for transaction models
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Has been cancelled
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Has been cancelled
Laravel Larastan / larastan (pull_request) Has been cancelled
Laravel Pint / pint (pull_request) Has been cancelled
This commit is contained in:
@@ -2,24 +2,29 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Eloquent\Prunable;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class ProductionLineStop extends Model
|
||||
{
|
||||
use Prunable;
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
"plant_id",
|
||||
"shift_id",
|
||||
"line_id",
|
||||
"linestop_id",
|
||||
"from_datetime",
|
||||
"to_datetime",
|
||||
"stop_hour",
|
||||
"stop_min",
|
||||
"operator_id",
|
||||
'plant_id',
|
||||
'line_id',
|
||||
'shift_id',
|
||||
'linestop_id',
|
||||
'from_datetime',
|
||||
'to_datetime',
|
||||
'stop_hour',
|
||||
'stop_min',
|
||||
'operator_id',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function plant(): BelongsTo
|
||||
@@ -48,5 +53,8 @@ class ProductionLineStop extends Model
|
||||
// return $this->belongsTo(LineStop::class, 'linestop_id');
|
||||
// }
|
||||
|
||||
|
||||
public function prunable(): Builder
|
||||
{
|
||||
return static::where('created_at', '<=', now()->subMonthsNoOverflow(6));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user