Skip to content

Commit a4bcd45

Browse files
committed
Refactor: Removed controller and moved version logic directly into API route
1 parent a2ead22 commit a4bcd45

File tree

2 files changed

+16
-37
lines changed

2 files changed

+16
-37
lines changed

app/Http/Controllers/Api/VersionController.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

routes/api.php

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,18 +1314,25 @@
13141314
}); // end reports api routes
13151315

13161316

1317-
1318-
/**
1319-
* Version API routes
1320-
*/ Route::get('/version',
1321-
[
1322-
Api\VersionController::class,
1323-
'index'
1324-
]
1317+
/**
1318+
* Version API routes
1319+
*/
1320+
Route::get(
1321+
'/version',
1322+
function () {
1323+
return response()->json(
1324+
[
1325+
'version' => config('version.app_version'),
1326+
'build_version' => config('version.build_version'),
1327+
'hash_version' => config('version.hash_version'),
1328+
'full_version' => config('version.full_app_version')
1329+
]
1330+
);
1331+
}
13251332
)->name('api.version.index'); // end version api routes
13261333

13271334

1328-
Route::fallback(function () {
1335+
Route::fallback(function () {
13291336
return response()->json(
13301337
[
13311338
'status' => 'error',

0 commit comments

Comments
 (0)