Skip to content
  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in
Logo1

hfpp2012 / laravel-blog

Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • laravel-blog
  • app
  • Http
  • Middleware
  • AuthenticatedMiddleware.php
  • hfpp2012 yinsigan's avatar
    middleware · e0507562
    hfpp2012 yinsigan committed Sep 07, 2017
    e0507562 Browse Files
AuthenticatedMiddleware.php 418 Bytes
RawBlameHistoryPermalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<?php

namespace App\Http\Middleware;

use Closure;
use Auth;

class AuthenticatedMiddleware
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if(Auth::check())
            return $next($request);
        return redirect('/login');
    }
}