Primo commit: trasferimento del progetto PPEasy

This commit is contained in:
2024-09-18 10:30:50 +02:00
commit eb475f257e
4233 changed files with 1043848 additions and 0 deletions
@@ -0,0 +1,35 @@
<?php
namespace Vanguard\Http\Middleware;
use Closure;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class VerifyInstallation
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*
* @throws \Symfony\Component\HttpKernel\Exception\HttpException
*/
public function handle($request, Closure $next)
{
if (app()->environment('testing')) {
return $next($request);
}
if (! file_exists(base_path('.env')) && ! $request->is('install*')) {
return redirect()->to('install');
}
if (file_exists(base_path('.env')) && $request->is('install*') && ! $request->is('install/complete')) {
throw new NotFoundHttpException;
}
return $next($request);
}
}