updated commit

This commit is contained in:
sujitprasad
2015-05-08 16:25:40 +05:30
parent ef834c58dc
commit 267467725e
73 changed files with 2748 additions and 2938 deletions

View File

@@ -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');
}
}