Created
May 16, 2017 16:09
-
-
Save Developeraya/f6aced78e32b82701ecde77f708ec85c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Cartalyst\Sentinel\Laravel\Facades\Sentinel; | |
use Closure; | |
class checkChangePasswordMiddleware | |
{ | |
/** | |
* The URIs that should be excluded from CSRF verification. | |
* | |
* @var array | |
*/ | |
protected $except = [ | |
'profile' | |
]; | |
/** | |
* Handle an incoming request. | |
* | |
* @param \Illuminate\Http\Request $request | |
* @param \Closure $next | |
* @return mixed | |
*/ | |
public function handle($request, Closure $next) | |
{ | |
$user = Sentinel::getUser(); | |
// if($user) | |
// { | |
if($user->change_password == 0) | |
{ | |
return redirect()->route('user.profile'); | |
} | |
else | |
{ | |
return $next($request); | |
} | |
// } | |
// else | |
// { | |
// return $next($request); | |
// } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment