FluxBB\Models\User::current PHP Method

current() public static method

public static current ( )
    public static function current()
    {
        static $current = null;
        if (Auth::guest()) {
            if (!isset($current)) {
                $current = new Guest();
            }
            return $current;
        }
        // We already have the logged in user's object
        return Auth::user();
    }

Usage Example

Esempio n. 1
0
 protected function run()
 {
     $id = $this->get('id');
     $post = $this->conversations->findPostById($id);
     $page = $this->conversations->getPageOfPost($post, User::current()->dispPosts());
     return ['post' => $post, 'page' => $page];
 }
All Usage Examples Of FluxBB\Models\User::current