create controller and these dependensi

This commit is contained in:
2025-08-03 17:42:21 +03:30
parent 64f94df74d
commit 07d8202469
11 changed files with 315 additions and 8 deletions

View File

@@ -20,7 +20,11 @@ class HarimOfficeController extends Controller
public function index(Request $request): JsonResponse
{
$query = Harim::query()->where('edareh_shahri_id', '=', auth()->user()->edarate_shahri_id);
$user = auth()->user();
$query = Harim::query()
->where('state_id','=',HarimStates::Baresi_Imeni_Rah_Tavasot_Daftar_Harim->value)
->where('edare_shahri_id', '=', $user->edarate_shahri_id)
->with('expert_description');
$data = DataTableFacade::run(
$query,
$request,
@@ -47,6 +51,7 @@ class HarimOfficeController extends Controller
$harim ->update([
'state_id' => $state,
'state_name' => HarimStates::name($state),
'final_description' => 'yes'
]);
});
return $this->successResponse();
@@ -69,6 +74,7 @@ class HarimOfficeController extends Controller
$harim ->update([
'state_id' => $state,
'state_name' => HarimStates::name($state),
'final_description' => 'no'
]);
});
return $this->successResponse();