Skip to content
Chris Konnertz edited this page May 27, 2019 · 4 revisions

Take a look into the app/helpers.php file for a complete list of the global helper functions that Contentify offers.

User

The user() helper function returns an instance of the current user (of class Contentify\Models\User) or null if the user is not authenticated. In Contentify speech, a user is a user agent that is authenticated (logged in). If a user agent isn't authenticated we refer to it as a visitor.

// Retrieve the instance:
$user = user();

// Check if user is authenticated:
if (user()) { 
    echo 'User authenticated!';
}