updated commit
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Middleware;
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
|
||||
/**
|
||||
* Authenticate
|
||||
*
|
||||
* @package Middleware
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class Authenticate {
|
||||
|
||||
/**
|
||||
@@ -18,8 +24,7 @@ class Authenticate {
|
||||
* @param Guard $auth
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth)
|
||||
{
|
||||
public function __construct(Guard $auth) {
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
@@ -30,16 +35,11 @@ class Authenticate {
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if ($this->auth->guest())
|
||||
{
|
||||
if ($request->ajax())
|
||||
{
|
||||
public function handle($request, Closure $next) {
|
||||
if ($this->auth->guest()) {
|
||||
if ($request->ajax()) {
|
||||
return response('Unauthorized.', 401);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
return redirect()->guest('auth/login');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user