Skip to content

Commit

Permalink
style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
murrant committed Apr 25, 2023
1 parent b6d854b commit ac7c11b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion app/Http/Controllers/Select/InventoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ protected function filterFields($request)
'device_id' => 'device',
];
}

protected function searchFields($request)
{
return [$this->fieldToColumn($request->get('field'))];
Expand All @@ -51,13 +52,15 @@ protected function searchFields($request)
protected function baseQuery($request)
{
$column = $this->fieldToColumn($request->get('field'));

return EntPhysical::hasAccess($request->user())
->select($column)
->orderBy($column)
->distinct();
}

private function fieldToColumn($field) {
private function fieldToColumn($field)
{
return match ($field) {
'name' => 'entPhysicalName',
'model' => 'entPhysicalModelName',
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/Select/PortFieldController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ protected function rules()

/**
* Defines fields that can be used as filters
*
* @param $request
* @return string[]
*/
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Table/InventoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function baseQuery($request)
}

/**
* @param EntPhysical $entPhysical
* @param EntPhysical $entPhysical
* @return array|Model|Collection
*/
public function formatItem($entPhysical)
Expand Down
2 changes: 0 additions & 2 deletions lang/en/inventory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@
'part' => 'Part',
'all_parts' => 'All Parts',
];


0 comments on commit ac7c11b

Please sign in to comment.