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(); }
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]; }