Removed searchable functionality and Added created_by drop-down list on report page
This commit is contained in:
@@ -136,7 +136,6 @@ class GuardPatrolEntryResource extends Resource
|
|||||||
->toArray();
|
->toArray();
|
||||||
})
|
})
|
||||||
->required()
|
->required()
|
||||||
// ->searchable()
|
|
||||||
->reactive()
|
->reactive()
|
||||||
// ->default(function () {
|
// ->default(function () {
|
||||||
// return optional(GuardPatrolEntry::where('created_by', Filament::auth()->user()?->name)->latest()->first())->check_point_name_id;
|
// return optional(GuardPatrolEntry::where('created_by', Filament::auth()->user()?->name)->latest()->first())->check_point_name_id;
|
||||||
@@ -231,27 +230,22 @@ class GuardPatrolEntryResource extends Resource
|
|||||||
Tables\Columns\TextColumn::make('plant.name')
|
Tables\Columns\TextColumn::make('plant.name')
|
||||||
->label('Plant')
|
->label('Plant')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->searchable()
|
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('guardNames.name') //guard_name_id
|
Tables\Columns\TextColumn::make('guardNames.name') //guard_name_id
|
||||||
->label('Guard Name')
|
->label('Guard Name')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->searchable()
|
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('checkPointNames.name') //check_point_name_id
|
Tables\Columns\TextColumn::make('checkPointNames.name') //check_point_name_id
|
||||||
->label('Check Point Name')
|
->label('Check Point Name')
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->searchable()
|
|
||||||
->sortable(),
|
->sortable(),
|
||||||
// Tables\Columns\TextColumn::make('reader_code')
|
// Tables\Columns\TextColumn::make('reader_code')
|
||||||
// ->label('Reader Code')
|
// ->label('Reader Code')
|
||||||
// ->alignCenter()
|
// ->alignCenter()
|
||||||
// ->searchable()
|
|
||||||
// ->sortable(),
|
// ->sortable(),
|
||||||
Tables\Columns\TextColumn::make('patrol_time')
|
Tables\Columns\TextColumn::make('patrol_time')
|
||||||
->label('Patrol Time')
|
->label('Patrol Time')
|
||||||
->dateTime()
|
->dateTime()
|
||||||
->searchable()
|
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('created_at')
|
Tables\Columns\TextColumn::make('created_at')
|
||||||
@@ -261,7 +255,6 @@ class GuardPatrolEntryResource extends Resource
|
|||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('created_by')
|
Tables\Columns\TextColumn::make('created_by')
|
||||||
->label('Created By')
|
->label('Created By')
|
||||||
->searchable()
|
|
||||||
->alignCenter(),
|
->alignCenter(),
|
||||||
Tables\Columns\TextColumn::make('updated_at')
|
Tables\Columns\TextColumn::make('updated_at')
|
||||||
->label('Updated At')
|
->label('Updated At')
|
||||||
@@ -270,7 +263,6 @@ class GuardPatrolEntryResource extends Resource
|
|||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('updated_by')
|
Tables\Columns\TextColumn::make('updated_by')
|
||||||
->label('Updated By')
|
->label('Updated By')
|
||||||
->searchable()
|
|
||||||
->alignCenter(),
|
->alignCenter(),
|
||||||
Tables\Columns\TextColumn::make('deleted_at')
|
Tables\Columns\TextColumn::make('deleted_at')
|
||||||
->label('Deleted At')
|
->label('Deleted At')
|
||||||
@@ -296,7 +288,7 @@ class GuardPatrolEntryResource extends Resource
|
|||||||
// $set('sap_msg_status', null);
|
// $set('sap_msg_status', null);
|
||||||
// }),
|
// }),
|
||||||
Select::make('Guard Name')
|
Select::make('Guard Name')
|
||||||
->label('Search by Guard Name')
|
->label('Select Guard Name')
|
||||||
->options(function (callable $get) {
|
->options(function (callable $get) {
|
||||||
$plantId = $get('Plant');
|
$plantId = $get('Plant');
|
||||||
if (!$plantId) {
|
if (!$plantId) {
|
||||||
@@ -305,10 +297,9 @@ class GuardPatrolEntryResource extends Resource
|
|||||||
|
|
||||||
return GuardName::where('plant_id', $plantId)->pluck('name', 'id')->toArray();
|
return GuardName::where('plant_id', $plantId)->pluck('name', 'id')->toArray();
|
||||||
})
|
})
|
||||||
->searchable()
|
|
||||||
->reactive(),
|
->reactive(),
|
||||||
Select::make('Check Point Name')
|
Select::make('Check Point Name')
|
||||||
->label('Search by Check Point Name')
|
->label('Select Check Point Name')
|
||||||
->options(function (callable $get) {
|
->options(function (callable $get) {
|
||||||
$plantId = $get('Plant');
|
$plantId = $get('Plant');
|
||||||
if (!$plantId) {
|
if (!$plantId) {
|
||||||
@@ -317,11 +308,19 @@ class GuardPatrolEntryResource extends Resource
|
|||||||
|
|
||||||
return CheckPointName::where('plant_id', $plantId)->pluck('name', 'id')->toArray();
|
return CheckPointName::where('plant_id', $plantId)->pluck('name', 'id')->toArray();
|
||||||
})
|
})
|
||||||
->searchable()
|
|
||||||
->reactive(),
|
->reactive(),
|
||||||
TextInput::make('Created By')
|
Select::make('Created By')
|
||||||
->label('Created By')
|
->label('Created By')
|
||||||
->placeholder('Enter Created By'),
|
->placeholder('Select Created By')
|
||||||
|
->options(function (callable $get) {
|
||||||
|
$plantId = $get('Plant');
|
||||||
|
if (!$plantId) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return GuardPatrolEntry::where('plant_id', $plantId)->orderBy('patrol_time', 'asc')->get()->unique('created_by')->pluck('created_by', 'created_by')->toArray();//, 'id'
|
||||||
|
})
|
||||||
|
->reactive(),
|
||||||
DateTimePicker::make(name: 'From Patrol Time')
|
DateTimePicker::make(name: 'From Patrol Time')
|
||||||
->label('From Patrol Time')
|
->label('From Patrol Time')
|
||||||
->beforeOrEqual('To Patrol Time')
|
->beforeOrEqual('To Patrol Time')
|
||||||
|
|||||||
Reference in New Issue
Block a user