use polyline encoder for command
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Mission;
|
||||
use App\Services\PolylineEncoder;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
@@ -24,8 +25,15 @@ class EncodePolyLineCommand extends Command
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle(PolylineEncoder $polylineEncoder)
|
||||
public function handle(PolylineEncoder $polylineEncoder): void
|
||||
{
|
||||
Mission::query()->whereNotNull('area')->each(function ($mission) use ($polylineEncoder) {
|
||||
$encodedValue = $polylineEncoder->encodePolyLine($mission, lng_lat_format:true);
|
||||
$mission->update([
|
||||
'encoded_route' => $encodedValue,
|
||||
]);
|
||||
});
|
||||
|
||||
$this->info("updated successfully");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ class ReportMachineController extends Controller
|
||||
allowedSortings: ['*'],
|
||||
allowedSelects: [
|
||||
'id', 'province_id', 'province_name', 'city_id', 'city_name',
|
||||
'end_km', 'km', 'driver_name', 'state_name',
|
||||
'end_km', 'km', 'driver_name', 'state_name', 'station_name'
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class RequestPortalController extends Controller
|
||||
return response()->json($requestPortalService->datatable($request));
|
||||
}
|
||||
|
||||
public function violations(Request $request): JsonResponse
|
||||
public function violations(Request $request): array
|
||||
{
|
||||
$query = MissionViolation::query()->where([
|
||||
['status', '=', MissionViolationStatus::BEDON_EGHDAM->value],
|
||||
|
||||
@@ -497,7 +497,7 @@ Route::prefix('missions')
|
||||
Route::get('/', 'index')->name('index');
|
||||
Route::get('/violations', 'violations')->name('violations');
|
||||
Route::post('/', 'store')->name('store');
|
||||
Route::post('/clarifyUnauthorizedExit/{violation}','clarifyUnauthorizedExit')->name('clarifyUnauthorizedExit');
|
||||
Route::post('/clarify_unauthorized_exit/{violation}','clarifyUnauthorizedExit')->name('clarifyUnauthorizedExit');
|
||||
Route::post('/continue/{mission}','continueMission')->name('continueMission');
|
||||
Route::get('/{mission}', 'show')->name('show');
|
||||
Route::post('/{mission}', 'update')->name('update');
|
||||
|
||||
Reference in New Issue
Block a user