Files
backend/app/Services/NikarayanService.php

38 lines
1.2 KiB
PHP

<?php
namespace App\Services;
use App\Models\RoadObserved;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use SoapClient;
class NikarayanService
{
protected SoapClient $soapClient;
public function __construct(SoapClient $soapClient)
{
$this->soapClient = $soapClient;
}
public function updateRoadObservedInfoByNikarayan(Request $request, RoadObserved $roadObserved, $files)
{
if (App::isProduction())
{
$array = array('strUserName' => 'vaytelrop',
'strPassword' => 'VaYtelROP*2024',
'strAutoID' => $roadObserved->fk_RegisteredEventMessage,
'strStateID' => ($request->input('rms-status') == 1) ? '2' : '3',
'strDescription' => $request->input('rms-description') ?? $roadObserved->rms_description,
'strPreviousImageLink' => "https://rms.rmto.ir/".$files,
'strNextImageLink' => "https://rms.rmto.ir/".$files,
'strRMSDateAndTime' => $roadObserved->updated_at
);
return $this->soapClient->UpdateInfo_RoadObservedProblems($array);
}
return 0;
}
}