Added updated from in sticker master resource page
Some checks failed
Gemini PR Review / Gemini PR Review (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Waiting to run
Laravel Larastan / larastan (pull_request) Waiting to run
Laravel Pint / pint (pull_request) Waiting to run
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

This commit is contained in:
dhanabalan
2026-04-14 15:24:14 +05:30
parent 568e9fb09c
commit bfb39e1db2

View File

@@ -780,13 +780,23 @@ class StickerMasterResource extends Resource
->placeholder(placeholder: 'Select To DateTime')
->reactive()
->native(false),
DateTimePicker::make(name: 'updated_from')
->label('Updated From')
->placeholder(placeholder: 'Select From DateTime')
->reactive()
->native(false),
DateTimePicker::make('updated_to')
->label('Updated To')
->placeholder(placeholder: 'Select To DateTime')
->reactive()
->native(false),
TextInput::make('updated_by')
->label('Updated By')
->placeholder(placeholder: 'Enter Updated By Name'),
])
->query(function ($query, array $data) {
// Hide all records initially if no filters are applied
if (empty($data['Plant']) && empty($data['item_id']) && empty($data['material_type']) && empty($data['panel_box_code']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['created_by']) && empty($data['updated_by'])) {
if (empty($data['Plant']) && empty($data['item_id']) && empty($data['material_type']) && empty($data['panel_box_code']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['updated_from']) && empty($data['updated_to']) && empty($data['created_by']) && empty($data['updated_by'])) {
return $query->whereRaw('1 = 0');
}
@@ -824,6 +834,14 @@ class StickerMasterResource extends Resource
$query->where('created_at', '<=', $data['created_to']);
}
if (! empty($data['updated_from'])) {
$query->where('updated_at', '>=', $data['updated_from']);
}
if (! empty($data['updated_to'])) {
$query->where('updated_at', '<=', $data['updated_to']);
}
if (! empty($data['updated_by'])) {
$query->where('updated_by', 'like', '%'.$data['updated_by'].'%');
}
@@ -872,6 +890,14 @@ class StickerMasterResource extends Resource
$indicators[] = 'To: '.$data['created_to'];
}
if (! empty($data['updated_from'])) {
$indicators[] = 'From: '.$data['updated_from'];
}
if (! empty($data['updated_to'])) {
$indicators[] = 'To: '.$data['updated_to'];
}
if (! empty($data['updated_by'])) {
$indicators[] = 'Updated By: '.$data['updated_by'];
}