mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 19:51:09 -04:00
init crater
This commit is contained in:
31
app/Http/Middleware/InstallationMiddleware.php
Normal file
31
app/Http/Middleware/InstallationMiddleware.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Laraspace\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Laraspace\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('/on-boarding');
|
||||
}
|
||||
|
||||
if (\Storage::disk('local')->has('database_created')) {
|
||||
if (Setting::getSetting('profile_complete') !== 'COMPLETED') {
|
||||
return redirect('/on-boarding');
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user