mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-11-03 22:13:18 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			32 lines
		
	
	
		
			709 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			709 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
namespace Crater\Http\Middleware;
 | 
						|
 | 
						|
use Closure;
 | 
						|
use Crater\Models\Setting;
 | 
						|
 | 
						|
class InstallationMiddleware
 | 
						|
{
 | 
						|
    /**
 | 
						|
     * Handle an incoming request.
 | 
						|
     *
 | 
						|
     * @param  \Illuminate\Http\Request  $request
 | 
						|
     * @param  \Closure  $next
 | 
						|
     * @return mixed
 | 
						|
     */
 | 
						|
    public function handle($request, Closure $next)
 | 
						|
    {
 | 
						|
        if (! \Storage::disk('local')->has('database_created')) {
 | 
						|
            return redirect('/installation');
 | 
						|
        }
 | 
						|
 | 
						|
        if (\Storage::disk('local')->has('database_created')) {
 | 
						|
            if (Setting::getSetting('profile_complete') !== 'COMPLETED') {
 | 
						|
                return redirect('/installation');
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        return $next($request);
 | 
						|
    }
 | 
						|
}
 |