$message = 'Your password has been expired. Please change your password.'; return Redirect::action('user.profile')->with($msgType, $message); } } else { $errorMsg = 'Please login using your credentials'; return Redirect::action('login.index')->with('error', $errorMsg); } }); Route::filter('check_merchant', function () { if (Auth::check()) { $userMember = UserMember::with('group')->where('user_id', Auth::user()->id)->get(); if ($userMember->count() > 0) { $fetch = array_fetch($userMember->toArray(), 'group.name'); if (in_array('Merchant', $fetch)) { $merchant_id = Auth::user()->id; $merchant = Merchant::find($merchant_id); $merchant_arr = array('merchant_id' => $merchant_id); Session::put('merchant', $merchant_arr); } } } else { $errorMsg = 'Please login using your credentials'; return Redirect::action('login.index')->with('error', $errorMsg); } }); /* |-------------------------------------------------------------------------- | Guest Filter |-------------------------------------------------------------------------- | | The "guest" filter is the counterpart of the authentication filters as