Adding a validation to segment model
Creating 'getLoggedUser' method for user model