DONE: centralize theme color, interactive dashboard, increase winner result, refer TODO
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Election;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
@@ -37,6 +38,18 @@ class Util extends Controller
|
||||
return \App\Election::find(Util::getCurrentElection())->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* When the latest election has finished (status 3), the next setup actions
|
||||
* must attach to a new draft row. Call before writes that bind to getCurrentElection().
|
||||
*/
|
||||
public static function ensureDraftElectionAfterCompletedCycle(): void
|
||||
{
|
||||
if (self::getElectionStatus() !== 3) {
|
||||
return;
|
||||
}
|
||||
Election::create();
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload image and return it's path
|
||||
* @param {Request} $request
|
||||
|
||||
Reference in New Issue
Block a user