mirror of
https://github.com/henrywhitaker3/Speedtest-Tracker.git
synced 2025-12-21 21:33:08 +01:00
Added changelog API method
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Exception;
|
||||
use Updater;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -58,4 +59,20 @@ class UpdateController extends Controller
|
||||
'success' => $cp,
|
||||
], 200);
|
||||
}
|
||||
|
||||
public function changelog()
|
||||
{
|
||||
$url = base_path() . '/changelog.json';
|
||||
|
||||
try {
|
||||
$changelog = json_decode(file_get_contents($url), true);
|
||||
} catch(Exception $e) {
|
||||
$changelog = [];
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
'method' => 'get changelog',
|
||||
'data' => $changelog
|
||||
], 200);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user