InstallerCheck.php 602 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Http\Middleware;
  3. use Closure;
  4. class InstallerCheck
  5. {
  6. /**
  7. * Handle an incoming request.
  8. *
  9. * @param \Illuminate\Http\Request $request
  10. * @param \Closure $next
  11. * @return mixed
  12. */
  13. public function handle($request, Closure $next)
  14. {
  15. if($this->alreadyInstalled()) {
  16. abort(404);
  17. }
  18. return $next($request);
  19. }
  20. /**
  21. * If application is already installed.
  22. *
  23. * @return bool
  24. */
  25. public function alreadyInstalled()
  26. {
  27. return file_exists(storage_path('installed'));
  28. }
  29. }