add start and finish time

This commit is contained in:
2026-01-25 16:16:37 +03:30
parent 44e7f6a321
commit 1775a8e75e
6 changed files with 50 additions and 6 deletions

View File

@@ -96,6 +96,8 @@ class ViolationManagementController extends Controller
}
public function store(StoreRequest $request): JsonResponse
{
$user = auth()->user();
MissionViolation::query()->create([
'machine_id'=> CMMSMachine::query()->where('machine_code', '=', $request->machine_code)->value('id'),
'machine_code'=> $request->machine_code,
@@ -104,6 +106,10 @@ class ViolationManagementController extends Controller
'request_date' => now(),
'km' => $request->km,
'gps' => 0,
'province_id' => $user->province_id,
'province_name' => $user->province_fa,
'city_id' => $user->city_id,
'city_name' => $user->city_fa,
]);
return $this->successResponse();