You've already forked Atomcms-edit
Fix middleware class collision (RadioApiKey -> alias), add missing setup.do and setup.reset routes, fix SSE int type cast
This commit is contained in:
@@ -107,6 +107,28 @@ class RadioSetupController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function doSetup(Request $request): RedirectResponse
|
||||
{
|
||||
return $this->setup($request);
|
||||
}
|
||||
|
||||
public function reset(): RedirectResponse
|
||||
{
|
||||
try {
|
||||
WebsiteSetting::where('key', 'like', 'radio_%')->delete();
|
||||
WebsiteSetting::where('key', 'like', 'points_%')->delete();
|
||||
|
||||
Artisan::call('config:clear');
|
||||
Artisan::call('cache:clear');
|
||||
|
||||
return redirect()->route('admin.radio.setup')
|
||||
->with('success', 'Radio instellingen zijn gereset.');
|
||||
} catch (\Exception $e) {
|
||||
return redirect()->route('admin.radio.setup')
|
||||
->with('error', 'Fout bij resetten: ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private function createDefaultRanks(): void
|
||||
{
|
||||
$ranks = [
|
||||
|
||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Models\RadioApiKey;
|
||||
use App\Models\RadioApiKey as RadioApiKeyModel;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -21,7 +21,7 @@ class RadioApiKey
|
||||
], 401);
|
||||
}
|
||||
|
||||
$apiKey = RadioApiKey::active()->where('key', $key)->first();
|
||||
$apiKey = RadioApiKeyModel::active()->where('key', $key)->first();
|
||||
|
||||
if (! $apiKey) {
|
||||
return response()->json([
|
||||
|
||||
Reference in New Issue
Block a user