diff --git a/app/Console/Commands/RoadObservationProblems.php b/app/Console/Commands/RoadObservationProblems.php index e25b3109..b585d167 100755 --- a/app/Console/Commands/RoadObservationProblems.php +++ b/app/Console/Commands/RoadObservationProblems.php @@ -78,8 +78,7 @@ class RoadObservationProblems extends Command $mobile = $value->MobileForSendEventSms; } - $city = findCityFromGeoJson($value->YGeo, $value->XGeo); - $cityModel = $city ? City::query()->find($city['city_id']) : City::query()->find(NikarayanComplaints::mapCities((int) $value->fk_Town)); + $cityModel = City::findCityWithLatLng($value->XGeo, $value->YGeo); $rop = RoadObserved::query()->updateOrCreate( ['fk_RegisteredEventMessage' => $value->fk_RegisteredEventMessage], [ diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index f4c047dd..296328c1 100755 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -42,8 +42,8 @@ class Kernel extends ConsoleKernel $schedule->command("webservice:roadobserved --daily-mode") ->dailyAt('00:45')->appendOutputTo(storage_path('logs/nikarayan.log')); -// $schedule->command("db:backup") -// ->weekly()->at('03:00')->appendOutputTo(storage_path('logs/mariadb-backup.log')); + $schedule->command("db:backup") + ->weekly()->at('03:00')->appendOutputTo(storage_path('logs/mariadb-backup.log')); $schedule->command('telescope:prune --hours=48') ->dailyAt('04:00') diff --git a/app/Http/Requests/V3/Mission/RequestPortal/UpdateRequest.php b/app/Http/Requests/V3/Mission/RequestPortal/UpdateRequest.php index fb80a7f6..d9764a7d 100644 --- a/app/Http/Requests/V3/Mission/RequestPortal/UpdateRequest.php +++ b/app/Http/Requests/V3/Mission/RequestPortal/UpdateRequest.php @@ -26,7 +26,7 @@ class UpdateRequest extends FormRequest public function rules(): array { return [ - 'rahdaran' => 'array', + 'rahdaran' => 'required|array', 'rahdaran.*' => 'exists:rahdaran,id', 'requested_machines' => 'required|array', 'type' => 'required|in:1,2', diff --git a/routes/v3.php b/routes/v3.php index 01351520..b060cdd2 100644 --- a/routes/v3.php +++ b/routes/v3.php @@ -388,7 +388,7 @@ Route::prefix('safety_and_privacy') Route::get('/map', 'map')->name('map'); Route::post('operator/second_step_store/{safetyAndPrivacy}', 'secondStepStore')->name('secondStepStore')->middleware(['validate-store-access','permission:add-safety-and-privacy','check-axis-type']); Route::post('operator/third_step_store/{safetyAndPrivacy}', 'thirdStepStore')->name('thirdStepStore')->middleware(['validate-store-access','permission:add-safety-and-privacy','check-axis-type']); - Route::post('operator/{safetyAndPrivacy}', 'update')->name('update'); + Route::post('operator/{safetyAndPrivacy}', 'update')->name('update')->middleware('permission:update-safety-and-privacy'); Route::get('operator/{safetyAndPrivacy}', 'show')->name('show'); Route::delete('operator/{safetyAndPrivacy}', 'destroy')->name('destroy')->middleware('permission:delete-safety-and-privacy'); Route::get('/deserialize/{safetyAndPrivacy}', 'deserialize')->name('deserialize');