forked from miguel456/rbrecruiter
Add save & update functionality to positions
Tooltips also added, as well as a general configuration file for Mojang Status URL. Relationships were also added between forms and Vacancies. Status verification for the dashboard was moved to a Service Provider, where it adds log entries when cache expires. Authentication controllers were also updated to reflect the new dashboard URL.
This commit is contained in:
41
app/Providers/MojangStatusProvider.php
Normal file
41
app/Providers/MojangStatusProvider.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\View;
|
||||
|
||||
class MojangStatusProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
|
||||
if (!Cache::has('mojang_status'))
|
||||
{
|
||||
Log::info("Mojang Status Provider: Mojang Status not found in the cache; Sending new request.");
|
||||
|
||||
$mcstatus = Http::get(config('general.urls.mojang.statuscheck'));
|
||||
Cache::put('mojang_status', base64_encode($mcstatus->body()), now()->addMinutes(60));
|
||||
}
|
||||
|
||||
View::share('mcstatus', json_decode(base64_decode(Cache::get('mojang_status')), true));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user