Skip to content

Instantly share code, notes, and snippets.

@Developeraya
Created May 16, 2017 16:09
Show Gist options
  • Save Developeraya/f6aced78e32b82701ecde77f708ec85c to your computer and use it in GitHub Desktop.
Save Developeraya/f6aced78e32b82701ecde77f708ec85c to your computer and use it in GitHub Desktop.
<?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