Merge pull request 'Refactored alignments and updated get_motor_master method' (#492) from ranjith-dev into master
Some checks are pending
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Waiting to run

Reviewed-on: #492
This commit was merged in pull request #492.
This commit is contained in:
2026-03-24 10:48:40 +00:00

View File

@@ -9,14 +9,7 @@ use App\Models\MotorTestingMaster;
use App\Models\Plant; use App\Models\Plant;
use App\Models\TestingPanelReading; use App\Models\TestingPanelReading;
use App\Models\WorkGroupMaster; use App\Models\WorkGroupMaster;
use DB;
use Filament\Notifications\Notification;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Mpdf\Mpdf;
use chillerlan\QRCode\QROptions;
use chillerlan\QRCode\Output\QROutputInterface;
use Mpdf\QrCode\Output;
use Mpdf\QrCode\QrCode;
use Str; use Str;
class TestingPanelController extends Controller class TestingPanelController extends Controller
@@ -40,30 +33,26 @@ class TestingPanelController extends Controller
$header_auth = $request->header('Authorization'); $header_auth = $request->header('Authorization');
$expectedToken = $expectedUser.':'.$expectedPw; $expectedToken = $expectedUser.':'.$expectedPw;
if ("Bearer " . $expectedToken != $header_auth) if ('Bearer '.$expectedToken != $header_auth) {
{
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => 'Invalid authorization token!' 'status_description' => 'Invalid authorization token!',
], 403); ], 403);
} }
$data = $request->all(); $data = $request->all();
if ($data['plant_code'] == null || $data['plant_code'] == '') if ($data['plant_code'] == null || $data['plant_code'] == '') {
{
// return response("ERROR: Please provide a valid plant code.", 400) // return response("ERROR: Please provide a valid plant code.", 400)
// ->header('Content-Type', 'text/plain'); // ->header('Content-Type', 'text/plain');
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Plant code can't be empty!" 'status_description' => "Plant code can't be empty!",
], 400); ], 400);
} } elseif (Str::length($data['plant_code']) < 4 || ! is_numeric($data['plant_code']) || ! preg_match('/^[1-9]\d{3,}$/', $data['plant_code'])) {// !ctype_digit($data['plant_code'])
else if (Str::length($data['plant_code']) < 4 || !is_numeric($data['plant_code']) || !preg_match('/^[1-9]\d{3,}$/', $data['plant_code']))//!ctype_digit($data['plant_code'])
{
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Invalid plant code found!" 'status_description' => 'Invalid plant code found!',
], 400); ], 400);
} }
@@ -72,88 +61,77 @@ class TestingPanelController extends Controller
// return response("Plant not found.", 400)->header('Content-Type', 'text/plain'); // return response("Plant not found.", 400)->header('Content-Type', 'text/plain');
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => 'Plant not found!' 'status_description' => 'Plant not found!',
], 400); ], 400);
} }
$plantId = $plant->id; $plantId = $plant->id;
if ($data['line_name'] == null || $data['line_name'] == '') if ($data['line_name'] == null || $data['line_name'] == '') {
{
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Group work center can't be empty!" 'status_description' => "Group work center can't be empty!",
], 400); ], 400);
} } elseif (Str::length($data['line_name']) < 0) {
else if (Str::length($data['line_name']) < 0)
{
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Invalid group work center found!" 'status_description' => 'Invalid group work center found!',
], 400); ], 400);
} }
$gWorkCenter = WorkGroupMaster::where('name', $data['line_name'])->first(); $gWorkCenter = WorkGroupMaster::where('name', $data['line_name'])->first();
if (!$gWorkCenter) if (! $gWorkCenter) {
{
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => 'Group work center not found!' 'status_description' => 'Group work center not found!',
], 400); ], 400);
} }
$gWorkCenter = WorkGroupMaster::where('name', $data['line_name'])->where('plant_id', $plantId)->first(); $gWorkCenter = WorkGroupMaster::where('name', $data['line_name'])->where('plant_id', $plantId)->first();
if (!$gWorkCenter) if (! $gWorkCenter) {
{
// return response( "Line not found for the specified plant : {$data['plant_code']}",400)->header('Content-Type', 'text/plain'); // return response( "Line not found for the specified plant : {$data['plant_code']}",400)->header('Content-Type', 'text/plain');
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Group work center not found for the specified plant : '{$data['plant_code']}'!" 'status_description' => "Group work center not found for the specified plant : '{$data['plant_code']}'!",
], 400); ], 400);
} }
$gWorkCenterId = $gWorkCenter->id; $gWorkCenterId = $gWorkCenter->id;
if ($data['machine_name'] == null || $data['machine_name'] == '') if ($data['machine_name'] == null || $data['machine_name'] == '') {
{
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Work center can't be empty!" 'status_description' => "Work center can't be empty!",
], 400); ], 400);
} } elseif (Str::length($data['machine_name']) < 0) {
else if (Str::length($data['machine_name']) < 0)
{
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Invalid work center found!" 'status_description' => 'Invalid work center found!',
], 400); ], 400);
} }
$machine = Machine::where('work_center', $data['machine_name'])->first(); $machine = Machine::where('work_center', $data['machine_name'])->first();
if (!$machine) if (! $machine) {
{
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => 'Work center not found!' 'status_description' => 'Work center not found!',
], 400); ], 400);
} }
$machine = Machine::where('work_center', $data['machine_name'])->where('plant_id', $plantId)->first(); $machine = Machine::where('work_center', $data['machine_name'])->where('plant_id', $plantId)->first();
if (!$machine) if (! $machine) {
{
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Work center not found for the specified plant : '{$data['plant_code']}'!" 'status_description' => "Work center not found for the specified plant : '{$data['plant_code']}'!",
], 400); ], 400);
} }
$machine = Machine::where('work_center', $data['machine_name'])->where('work_group_master_id', $gWorkCenterId)->first(); $machine = Machine::where('work_center', $data['machine_name'])->where('work_group_master_id', $gWorkCenterId)->first();
if (!$machine) if (! $machine) {
{
// return response("Machine not found for the specified line : {$data['line_name']}", 400)->header('Content-Type', 'text/plain'); // return response("Machine not found for the specified line : {$data['line_name']}", 400)->header('Content-Type', 'text/plain');
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Work center not found for the specified Group work center : '{$data['line_name']}'!" 'status_description' => "Work center not found for the specified Group work center : '{$data['line_name']}'!",
], 400); ], 400);
} }
@@ -162,46 +140,39 @@ class TestingPanelController extends Controller
if (! $machine) { if (! $machine) {
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Work center not found for the specified Plant : '{$data['plant_code']}' and Group work center : '{$data['line_name']}'!" 'status_description' => "Work center not found for the specified Plant : '{$data['plant_code']}' and Group work center : '{$data['line_name']}'!",
], 400); ], 400);
} }
$lineId = $machine->line_id; $lineId = $machine->line_id;
$machineId = $machine->id; $machineId = $machine->id;
try try {
{
$insertedSerials = []; $insertedSerials = [];
$missedItemCodes = []; $missedItemCodes = [];
$duplicateItemCodes = []; $duplicateItemCodes = [];
$existSnoCount = []; $existSnoCount = [];
if (!empty($data['item_codes']) && is_array($data['item_codes'])) if (! empty($data['item_codes']) && is_array($data['item_codes'])) {
{ foreach ($data['item_codes'] as $item) {
foreach ($data['item_codes'] as $item)
{
$code = $item['item_code'] ?? null; $code = $item['item_code'] ?? null;
// Check if item_code is present // Check if item_code is present
if ($code == '' || $code == null) if ($code == '' || $code == null) {
{
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Item code can't be empty!" 'status_description' => "Item code can't be empty!",
], 400); ], 400);
} }
// Collect duplicates // Collect duplicates
if (isset($itemCodeCounts[$code])) if (isset($itemCodeCounts[$code])) {
{
$itemCodeCounts[$code]++; $itemCodeCounts[$code]++;
// Only add to duplicates array once // Only add to duplicates array once
if ($itemCodeCounts[$code] == 2) { if ($itemCodeCounts[$code] == 2) {
$duplicateItemCodes[] = $code; $duplicateItemCodes[] = $code;
} }
} } else {
else
{
$itemCodeCounts[$code] = 1; $itemCodeCounts[$code] = 1;
} }
@@ -214,8 +185,7 @@ class TestingPanelController extends Controller
} }
if (! empty($item['serial_numbers']) && is_array($item['serial_numbers'])) { if (! empty($item['serial_numbers']) && is_array($item['serial_numbers'])) {
foreach ($item['serial_numbers'] as $serial) foreach ($item['serial_numbers'] as $serial) {
{
$existSnoCount[] = $serial['serial_number']; $existSnoCount[] = $serial['serial_number'];
} }
} }
@@ -225,7 +195,7 @@ class TestingPanelController extends Controller
if (! empty($duplicateItemCodes)) { if (! empty($duplicateItemCodes)) {
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => 'Duplicate item codes found in request: ' . implode(', ', $duplicateItemCodes) 'status_description' => 'Duplicate item codes found in request: '.implode(', ', $duplicateItemCodes),
], 400); ], 400);
} }
@@ -238,14 +208,13 @@ class TestingPanelController extends Controller
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Item codes : ". implode(', ', $uniqueInvalidCodes)." not found in master for the specified plant : '{$plant->name}'!" 'status_description' => 'Item codes : '.implode(', ', $uniqueInvalidCodes)." not found in master for the specified plant : '{$plant->name}'!",
], 400); ], 400);
} }
$insertedSnoCount = []; $insertedSnoCount = [];
foreach ($data['item_codes'] as $item) foreach ($data['item_codes'] as $item) {
{
$motorTestingMaster = MotorTestingMaster::whereHas('item', callback: function ($query) use ($item) { $motorTestingMaster = MotorTestingMaster::whereHas('item', callback: function ($query) use ($item) {
$query->where('code', $item['item_code']); $query->where('code', $item['item_code']);
@@ -253,10 +222,8 @@ class TestingPanelController extends Controller
$motorTestingMasterId = $motorTestingMaster->id; $motorTestingMasterId = $motorTestingMaster->id;
if (!empty($item['serial_numbers']) && is_array($item['serial_numbers'])) if (! empty($item['serial_numbers']) && is_array($item['serial_numbers'])) {
{ foreach ($item['serial_numbers'] as $serial) {
foreach ($item['serial_numbers'] as $serial)
{
// For update_count calculation // For update_count calculation
$updateCount = [ $updateCount = [
'plant_id' => $plantId, 'plant_id' => $plantId,
@@ -346,32 +313,27 @@ class TestingPanelController extends Controller
} }
} }
if (!empty($insertedSerials)) if (! empty($insertedSerials)) {
{ if (count($existSnoCount) == count($insertedSnoCount)) {
if(count($existSnoCount) == count($insertedSnoCount))
{
// $messages[] = "Inserted serial numbers are: " . implode(', ', $insertedSerials); // $messages[] = "Inserted serial numbers are: " . implode(', ', $insertedSerials);
return response()->json([ return response()->json([
'status_code' => 'SUCCESS', 'status_code' => 'SUCCESS',
'status_description' => 'Inserted serial numbers are: ' . implode(', ', $insertedSerials) 'status_description' => 'Inserted serial numbers are: '.implode(', ', $insertedSerials),
], 200); ], 200);
} } else {
else
{
$missingSno = array_diff($existSnoCount, $insertedSnoCount); $missingSno = array_diff($existSnoCount, $insertedSnoCount);
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Missed serial numbers are: " . implode(', ', $missingSno) 'status_description' => 'Missed serial numbers are: '.implode(', ', $missingSno),
], 400); ], 400);
} }
} }
} } catch (\Exception $e) {
catch (\Exception $e)
{
// return response($e->getMessage(), 500)->header('Content-Type', 'text/plain'); // return response($e->getMessage(), 500)->header('Content-Type', 'text/plain');
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => 'Store testing panel readings internal server error : '.$e?->getCode() 'status_description' => 'Store testing panel readings internal server error : '.$e?->getCode(),
], 500); ], 500);
} }
} }
@@ -387,11 +349,10 @@ class TestingPanelController extends Controller
$expectedToken = $expectedUser.':'.$expectedPw; $expectedToken = $expectedUser.':'.$expectedPw;
// $data = $request->all(); // $data = $request->all();
if ("Bearer " . $expectedToken != $header_auth) if ('Bearer '.$expectedToken != $header_auth) {
{
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => 'Invalid authorization token!' 'status_description' => 'Invalid authorization token!',
], 403); ], 403);
} }
@@ -399,37 +360,38 @@ class TestingPanelController extends Controller
$itemCode = $request->header('item-code'); $itemCode = $request->header('item-code');
// $description = $item ? $item->description : ''; // $description = $item ? $item->description : '';
if ($plantCode == null || $plantCode == '') if ($plantCode == null || $plantCode == '') {
{
// return response("ERROR: Plant Name can't be empty", 400) // return response("ERROR: Plant Name can't be empty", 400)
// ->header('Content-Type', 'text/plain'); // ->header('Content-Type', 'text/plain');
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Plant code can't be empty!" 'status_description' => "Plant code can't be empty!",
], 400); ], 400);
} } elseif (Str::length($plantCode) < 4 || ! is_numeric($plantCode) || ! preg_match('/^[1-9]\d{3,}$/', $plantCode)) {
else if (Str::length($plantCode) < 4 || !is_numeric($plantCode) || !preg_match('/^[1-9]\d{3,}$/', $plantCode))
{
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Invalid plant code found!" 'status_description' => 'Invalid plant code found!',
], 400); ], 400);
} } elseif ($itemCode == null || $itemCode == '' || ! $itemCode) {
else if($itemCode == null || $itemCode == '')
{
// return response("ERROR: OBD Number can't be empty", 400)
// ->header('Content-Type', 'text/plain');
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Item Code can't be empty!" 'status_description' => "Item code can't be empty!",
], 400); ], 404);
} } elseif (Str::length($itemCode) < 6) {
else if(Str::length($itemCode) < 6 || !ctype_alnum($itemCode))
{
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Invalid item code found!" 'status_description' => "Item code '{$itemCode}' should contain minimum 6 digits!",
], 400); ], 404);
} elseif (! ctype_alnum($itemCode)) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Item code '{$itemCode}' should contain only alpha-numeric values!",
], 404);
} elseif (! preg_match('/^[a-zA-Z1-9][a-zA-Z0-9]{5,}$/', $itemCode)) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Item code '{$itemCode}' should not begin with '0'!",
], 404);
} }
$plant = Plant::where('code', $plantCode)->first(); $plant = Plant::where('code', $plantCode)->first();
@@ -437,7 +399,7 @@ class TestingPanelController extends Controller
if (! $plant) { if (! $plant) {
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Plant not found!" 'status_description' => 'Plant not found!',
], 400); ], 400);
} }
@@ -445,72 +407,79 @@ class TestingPanelController extends Controller
$item = Item::where('code', $itemCode)->first(); $item = Item::where('code', $itemCode)->first();
if (!$item) if (! $item) {
{
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Item Code not found in item table!" 'status_description' => 'Item code not found in item table!',
], 404); ], 404);
} }
$item = Item::where('plant_id', $plantId)->where('code', $itemCode)->first(); $item = Item::where('plant_id', $plantId)->where('code', $itemCode)->first();
if (!$item) if (! $item) {
{
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Item Code not found in item table for the plant : '$plant->name'!" 'status_description' => "Item code not found in item table for the plant : '$plant->name'!",
], 404); ], 404);
} }
// Get description or empty string if not found $itemId = $item->id;
$description = $item ? $item->description : ''; $description = $item ? $item->description : '';
$category = $item ? $item->category : ''; $category = $item ? $item->category : '';
$motorTestingMaster = MotorTestingMaster::where('plant_id', $plantId)->where('item_id', $item->id)->first(); $motorTestingMaster = MotorTestingMaster::where('item_id', $itemId)->first();
if (!$motorTestingMaster) if (! $motorTestingMaster) {
{
return response()->json([ return response()->json([
'status_code' => 'ERROR', 'status_code' => 'ERROR',
'status_description' => "Item Code not found in motor testing master table for the plant : '$plant->name'!" 'status_description' => 'Item code not found in motor testing master table!',
], 404);
}
$motorTestingMaster = MotorTestingMaster::where('plant_id', $plantId)->where('item_id', $itemId)->first();
if (! $motorTestingMaster) {
return response()->json([
'status_code' => 'ERROR',
'status_description' => "Item code not found in motor testing master table for the plant : '$plant->name'!",
], 404); ], 404);
} }
$output = [ $output = [
"mot_subassembly_code" => $motorTestingMaster->subassembly_code ?? "", 'mot_subassembly_code' => $motorTestingMaster->subassembly_code ?? '',
"mot_model_name" => $description, 'mot_model_name' => ($itemCode == '123456') ? 'SAMPLE TYPE' : $description,
"mot_non_isi_model" => $motorTestingMaster->isi_model ? "0" :"1", 'mot_non_isi_model' => $motorTestingMaster->isi_model ? '0' : '1',
"mot_phase" => $motorTestingMaster->phase ?? "", 'mot_phase' => $motorTestingMaster->phase ?? '',
"mot_hp" => $motorTestingMaster->hp ?? "", 'mot_hp' => $motorTestingMaster->hp ?? '',
"mot_kw" => $motorTestingMaster->kw ?? "", 'mot_kw' => $motorTestingMaster->kw ?? '',
"mot_volt" => $motorTestingMaster->volt ?? "", 'mot_volt' => $motorTestingMaster->volt ?? '',
"mot_cur" => $motorTestingMaster->current ?? "", 'mot_cur' => $motorTestingMaster->current ?? '',
"mot_rpm" => $motorTestingMaster->rpm ?? "", 'mot_rpm' => $motorTestingMaster->rpm ?? '',
"mot_rate_torque_kg" => $motorTestingMaster->torque ?? "", 'mot_rate_torque_kg' => $motorTestingMaster->torque ?? '',
"mot_freq" => $motorTestingMaster->frequency ?? "", 'mot_freq' => $motorTestingMaster->frequency ?? '',
"mot_conn" => $motorTestingMaster->connection ?? "", 'mot_conn' => $motorTestingMaster->connection ?? '',
"mot_ins_res_limit" => $motorTestingMaster->ins_res_limit ?? "", 'mot_ins_res_limit' => $motorTestingMaster->ins_res_limit ?? '',
"mot_ins_res_type" => $motorTestingMaster->ins_res_type ?? "", 'mot_ins_res_type' => $motorTestingMaster->ins_res_type ?? '',
"mot_category" => $category, 'mot_category' => $category,
"mot_routine_test_time" => $motorTestingMaster->routine_test_time ?? "", 'mot_routine_test_time' => $motorTestingMaster->routine_test_time ?? '',
"mot_res_ry_ll" => $motorTestingMaster->res_ry_ll ?? "", 'mot_res_ry_ll' => $motorTestingMaster->res_ry_ll ?? '',
"mot_res_ry_ul" => $motorTestingMaster->res_ry_ul ?? "", 'mot_res_ry_ul' => $motorTestingMaster->res_ry_ul ?? '',
"mot_res_yb_ll" => $motorTestingMaster->res_yb_ll ?? "", 'mot_res_yb_ll' => $motorTestingMaster->res_yb_ll ?? '',
"mot_res_yb_ul" => $motorTestingMaster->res_yb_ul ?? "", 'mot_res_yb_ul' => $motorTestingMaster->res_yb_ul ?? '',
"mot_res_br_ll" => $motorTestingMaster->res_br_ll ?? "", 'mot_res_br_ll' => $motorTestingMaster->res_br_ll ?? '',
"mot_res_br_ul" => $motorTestingMaster->res_br_ul ?? "", 'mot_res_br_ul' => $motorTestingMaster->res_br_ul ?? '',
"mot_lock_volt_limit" => $motorTestingMaster->lock_volt_limit ?? "", 'mot_lock_volt_limit' => $motorTestingMaster->lock_volt_limit ?? '',
"mot_leak_cur_limit" => $motorTestingMaster->leak_cur_limit ?? "", 'mot_leak_cur_limit' => $motorTestingMaster->leak_cur_limit ?? '',
"mot_lock_cur_ll" => $motorTestingMaster->lock_cur_ll ?? "", 'mot_lock_cur_ll' => $motorTestingMaster->lock_cur_ll ?? '',
"mot_lock_cur_ul" => $motorTestingMaster->lock_cur_ul ?? "", 'mot_lock_cur_ul' => $motorTestingMaster->lock_cur_ul ?? '',
"mot_noload_cur_ll" => $motorTestingMaster->noload_cur_ll ?? "", 'mot_noload_cur_ll' => $motorTestingMaster->noload_cur_ll ?? '',
"mot_noload_cur_ul" => $motorTestingMaster->noload_cur_ul ?? "", 'mot_noload_cur_ul' => $motorTestingMaster->noload_cur_ul ?? '',
"mot_noload_pow_ll" => $motorTestingMaster->noload_pow_ll ?? "", 'mot_noload_pow_ll' => $motorTestingMaster->noload_pow_ll ?? '',
"mot_noload_pow_ul" => $motorTestingMaster->noload_pow_ul ?? "", 'mot_noload_pow_ul' => $motorTestingMaster->noload_pow_ul ?? '',
"mot_noload_spd_ll" => $motorTestingMaster->noload_spd_ll ?? "", 'mot_noload_spd_ll' => $motorTestingMaster->noload_spd_ll ?? '',
"mot_noload_spd_ul" => $motorTestingMaster->noload_spd_ul ?? "" 'mot_noload_spd_ul' => $motorTestingMaster->noload_spd_ul ?? '',
]; ];
return response()->json($output, 200); return response()->json($output, 200);