Files
UNIT3D-Community-Edition/app/Http/Middleware/CheckForPrivate.php
HDVinnie f3010a3d49 (Update) Update Middelware
- remove facade use and replace with helpers
- cleanup
2018-03-21 12:03:16 -04:00

35 lines
779 B
PHP
Executable File

<?php
/**
* NOTICE OF LICENSE
*
* UNIT3D is open-sourced software licensed under the GNU General Public License v3.0
* The details is bundled with this project in the file LICENSE.txt.
*
* @project UNIT3D
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
* @author HDVinnie
*/
namespace App\Http\Middleware;
use Closure;
class CheckForPrivate
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (config('other.private') && !auth()->check()) {
return redirect('/login');
}
return $next($request);
}
}