mirror of
https://github.com/koel/koel
synced 2024-12-21 18:13:13 +00:00
30 lines
609 B
PHP
30 lines
609 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Middleware;
|
||
|
|
||
|
use Closure;
|
||
|
use Illuminate\Http\Request;
|
||
|
|
||
|
/**
|
||
|
* Check if the app is running in an E2E session and use the proper data settings.
|
||
|
*/
|
||
|
class UseDifferentConfigIfE2E
|
||
|
{
|
||
|
/**
|
||
|
* Handle an incoming request.
|
||
|
*
|
||
|
* @param \Illuminate\Http\Request $request
|
||
|
* @param \Closure $next
|
||
|
*
|
||
|
* @return mixed
|
||
|
*/
|
||
|
public function handle(Request $request, Closure $next)
|
||
|
{
|
||
|
if ($_SERVER['SERVER_PORT'] === '8081') {
|
||
|
config(['database.default' => 'sqlite-e2e']);
|
||
|
}
|
||
|
|
||
|
return $next($request);
|
||
|
}
|
||
|
}
|