Major changes - Vote system now finished

This commit is contained in:
2020-05-30 00:20:39 +01:00
parent cc8c293cc6
commit d15c0cb12f
32 changed files with 1791 additions and 17 deletions

View File

@@ -20,6 +20,12 @@ class EventServiceProvider extends ServiceProvider
SendEmailVerificationNotification::class,
OnUserRegistration::class
],
'App\Events\ApplicationApprovedEvent' => [
'App\Listeners\PromoteUser'
],
'App\Events\ApplicationDeniedEvent' => [
'App\Listeners\DenyUser'
]
];
/**
@@ -29,6 +35,7 @@ class EventServiceProvider extends ServiceProvider
*/
public function boot()
{
parent::boot();
//

View File

@@ -2,6 +2,7 @@
namespace App\Providers;
use GuzzleHttp\Exception\ConnectException;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
@@ -32,8 +33,17 @@ class MojangStatusProvider extends ServiceProvider
{
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));
try
{
$mcstatus = Http::get(config('general.urls.mojang.statuscheck'));
Cache::put('mojang_status', base64_encode($mcstatus->body()), now()->addDays(3));
}
catch(ConnectException $connectException)
{
Log::critical('Could not connect to Mojang servers: Cannot check/refresh status', [
'message' => $connectException->getMessage()
]);
}
}
View::share('mcstatus', json_decode(base64_decode(Cache::get('mojang_status')), true));