Cachet/app/Http/Middleware/SetupAlreadyCompleted.php

37 lines
763 B
PHP
Raw Normal View History

2014-11-23 21:34:31 +00:00
<?php
/*
* This file is part of Cachet.
*
2015-07-06 17:37:01 +01:00
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
2015-03-20 18:30:45 -06:00
namespace CachetHQ\Cachet\Http\Middleware;
2015-03-20 18:30:45 -06:00
use Closure;
2016-01-29 22:49:06 +00:00
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Redirect;
2015-12-24 17:30:59 +00:00
class SetupAlreadyCompleted
2014-12-20 21:20:17 +00:00
{
2015-01-02 00:54:16 +00:00
/**
2015-12-24 17:30:59 +00:00
* Handle an incoming request.
2015-01-02 00:54:16 +00:00
*
2015-12-22 08:41:03 +00:00
* @param \Illuminate\Http\Request $request
* @param \Closure $next
2015-01-02 00:54:16 +00:00
*
2015-03-20 18:30:45 -06:00
* @return mixed
2015-01-02 00:54:16 +00:00
*/
2015-03-20 18:30:45 -06:00
public function handle($request, Closure $next)
2014-12-20 21:20:17 +00:00
{
2016-01-29 22:49:06 +00:00
if (Config::get('setting.app_name')) {
2015-09-19 12:24:53 +01:00
return Redirect::to('dashboard');
}
2015-03-20 18:30:45 -06:00
return $next($request);
}
}