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');
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Middleware;
|
||||
use Closure;
|
||||
|
||||
/**
|
||||
* CheckRole
|
||||
*
|
||||
* @package Middleware
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CheckRole {
|
||||
|
||||
/**
|
||||
@@ -17,7 +23,6 @@ class CheckRole {
|
||||
return $next($request);
|
||||
}
|
||||
return redirect('guest')->with('fails', 'You are not Autherised');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Middleware;
|
||||
use Closure;
|
||||
|
||||
/**
|
||||
* CheckRoleAgent
|
||||
*
|
||||
* @package default
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CheckRoleAgent {
|
||||
|
||||
/**
|
||||
|
@@ -1,7 +1,13 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
|
||||
<?php
|
||||
namespace App\Http\Middleware;
|
||||
use Closure;
|
||||
|
||||
/**
|
||||
* CheckRoleUser
|
||||
*
|
||||
* @package Middleware
|
||||
* @author Ladybird <info@ladybirdweb.com>
|
||||
*/
|
||||
class CheckRoleUser {
|
||||
|
||||
/**
|
||||
@@ -16,7 +22,6 @@ class CheckRoleUser {
|
||||
return $next($request);
|
||||
}
|
||||
return redirect('guest')->with('fails', 'You are not Autherised');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1,4 +1,6 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Contracts\Auth\Guard;
|
||||
@@ -19,8 +21,7 @@ class RedirectIfAuthenticated {
|
||||
* @param Guard $auth
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Guard $auth)
|
||||
{
|
||||
public function __construct(Guard $auth) {
|
||||
$this->auth = $auth;
|
||||
}
|
||||
|
||||
@@ -31,10 +32,8 @@ class RedirectIfAuthenticated {
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if ($this->auth->check())
|
||||
{
|
||||
public function handle($request, Closure $next) {
|
||||
if ($this->auth->check()) {
|
||||
return new RedirectResponse(url('dashboard'));
|
||||
}
|
||||
|
||||
|
@@ -1,19 +1,21 @@
|
||||
<?php namespace App\Http\Middleware;
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
||||
|
||||
class VerifyCsrfToken extends BaseVerifier {
|
||||
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next) {
|
||||
return parent::handle($request, $next);
|
||||
}
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next) {
|
||||
return parent::handle($request, $next);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user