create history api

This commit is contained in:
2025-11-26 13:53:22 +03:30
parent 6a8d27b2c3
commit 8fba75a684
7 changed files with 44 additions and 11 deletions

View File

@@ -35,7 +35,15 @@ class GeneralManagerController extends Controller
public function index(Request $request): JsonResponse
{
$query = Harim::query()
->where('province_id', '=', auth()->user()->province_id);
->where('province_id', '=', auth()->user()->province_id)
->orderByRaw("
CASE state
WHEN 4 THEN 1
WHEN 7 THEN 2
WHEN 15 THEN 3
ELSE 4
END
");
$data = DataTableFacade::run(
$query,
@@ -178,7 +186,7 @@ class GeneralManagerController extends Controller
public function show(ShowRequest $request, Harim $harim): JsonResponse
{
return $this->successResponse($harim->load('histories'));
return $this->successResponse($harim);
}
/**