/** * Determine if the user is authorized to make this request. * * @param Guard $auth * @return bool */ public function authorize(Guard $auth) { if ($auth->check() && PermissionsHelper::changeLanguage()) { return true; } return false; }
/** * Render index page. */ public function index() { $data = ['allowUserToChangeLanguage' => false]; if (PermissionsHelper::changeLanguage()) { $data['allowUserToChangeLanguage'] = true; } return view('settings')->with($data); }