Started building update functions out

This commit is contained in:
Henry Whitaker
2020-04-10 01:13:34 +01:00
parent 714daae571
commit dac08458d4
9 changed files with 66 additions and 16 deletions

View File

@@ -0,0 +1,13 @@
<?php
namespace App\Helpers;
use Exception;
class UpdateHelper {
public static function check()
{
$current = config('app.version', false);
(!$current) ? false : '';
}
}

View File

@@ -0,0 +1,16 @@
<?php
namespace App\Http\Controllers;
use App\Helpers\UpdateHelper;
use Illuminate\Http\Request;
class UpdateController extends Controller
{
public function checkForUpdate()
{
return response()->json([
'update' => UpdateHelper::check(),
], 200);
}
}

10
composer.lock generated
View File

@@ -690,16 +690,16 @@
},
{
"name": "laravel/framework",
"version": "v7.5.1",
"version": "v7.5.2",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "b2457b1ddb9c59396313eae4e948bdc5fa5251db"
"reference": "3a3b3f7fea69813f5a03449c6314bfb42c3ccf78"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/b2457b1ddb9c59396313eae4e948bdc5fa5251db",
"reference": "b2457b1ddb9c59396313eae4e948bdc5fa5251db",
"url": "https://api.github.com/repos/laravel/framework/zipball/3a3b3f7fea69813f5a03449c6314bfb42c3ccf78",
"reference": "3a3b3f7fea69813f5a03449c6314bfb42c3ccf78",
"shasum": ""
},
"require": {
@@ -837,7 +837,7 @@
"framework",
"laravel"
],
"time": "2020-04-07T18:52:38+00:00"
"time": "2020-04-08T15:54:18+00:00"
},
{
"name": "laravel/tinker",

View File

@@ -123,14 +123,6 @@ return [
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Version numebr
|--------------------------------------------------------------------------
*/
'version' => '1.1.0',
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers

21
config/speedtest.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Version numebr
|--------------------------------------------------------------------------
*/
'version' => '1.1.0',
/*
|--------------------------------------------------------------------------
| GitHub Repo Variables
|--------------------------------------------------------------------------
*/
'user' => 'henrywhitaker3',
'repo' => 'Speedtest-Tracker',
'branch' => 'master',
];

2
public/js/app.js vendored
View File

@@ -126769,7 +126769,7 @@ var Restore = /*#__PURE__*/function (_Component) {
};
var url = '/api/restore';
axios__WEBPACK_IMPORTED_MODULE_4___default.a.post(url, data).then(function (resp) {
react_toastify__WEBPACK_IMPORTED_MODULE_3__["toast"].success('Your is being restored...');
react_toastify__WEBPACK_IMPORTED_MODULE_3__["toast"].success('Your data is being restored...');
_this.setState({
show: false,

View File

@@ -57,7 +57,7 @@ export default class Restore extends Component {
Axios.post(url, data)
.then((resp) => {
toast.success('Your is being restored...');
toast.success('Your data is being restored...');
this.setState({
show: false,
data: null,

View File

@@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta name="author" content="Henry Whitaker">
<meta name="version" content="{{ config('app.version', 'Unknown') }}">
<meta name="version" content="{{ config('speedtest.version', 'Unknown') }}">
<link href="/icons/themify/themify-icons.css" rel="stylesheet">
<link rel="stylesheet" href="/css/bootstrap.dark.min.css">

View File

@@ -37,3 +37,11 @@ Route::group([
Route::post('restore', 'BackupController@restore')
->name('data.restore');
});
Route::group([
'middleware' => 'api',
'prefix' => 'update',
], function () {
Route::get('check', 'UpdateController@checkForUpdate')
->name('update.check');
});