Installer updates
Added probe.php Added new installer views and controllers Updated AuthController Updated Middlewares Updated Commands for installation process
This commit is contained in:
32
app/Http/Middleware/IsInstalled.php
Normal file
32
app/Http/Middleware/IsInstalled.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
|
||||
class IsInstalled
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if (!isInstall()) {
|
||||
return $next($request);
|
||||
} else {
|
||||
if ($request->isJson()) {
|
||||
$url = url('/');
|
||||
$result = ['fails' => 'already installed', 'api' => $url];
|
||||
|
||||
return response()->json(compact('result'));
|
||||
} else {
|
||||
return redirect('/');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user