GET: Return a new/updated threads view.

@return \Illuminate\Http\Response
422448
public function indexNew()
    {
        $threads = $this->api('thread.index-new')->get();

        event(new UserViewingNew($threads));

        return view('forum::thread.index-new', compact('threads'));
    }
1243042
public function actionPageviews()
	{
		$models = Events::model()->groupByUrl()->findAll();
		$response = array();

		foreach ($models as $model)
			$response[] = array(
				'uri' => $model->uri,
				'count' => $model->id
			);

		return $response;
	}
827510
public function getReviews()
    {
        if ($this->_aReviews === null) {
            $this->_aReviews = false;
            if ($oObject = $this->_getActiveObject()) {
                $this->_aReviews = $oObject->getReviews();
            }
        }

        return $this->_aReviews;
    }
754435
public function index()
    {
        $openedTickets = Ticket::where('user_id', '=', Auth::id())->where('open', true)->orderBy('updated_at', 'desc')->get();
        $closedTickets = Ticket::where('user_id', '=', Auth::id())->where('open', false)->orderBy('updated_at', 'desc')->get();

        return view('laralum_tickets::public.index', ['openedTickets' => $openedTickets, 'closedTickets' => $closedTickets]);
    }
247488
protected function getNewView()
    {
        if ($this->currentSite) {
            return str_replace(
                ['.blade.php'],
                [''],
                $this->sitesFolder.'.'.$this->currentSite->slug.'.'.$this->currentPath
            );
        }

        return $this->currentPath;
    }
746187
public function index()
    {
        $currentUserId = Auth::user()->id;

        // All threads, ignore deleted/archived participants
        $threads = Thread::getAllLatest()->get();

        // All threads that user is participating in
        // $threads = Thread::forUser($currentUserId)->latest('updated_at')->get();

        // All threads that user is participating in, with new messages
        // $threads = Thread::forUserWithNewMessages($currentUserId)->latest('updated_at')->get();

        return view('chat.index', compact('threads', 'currentUserId'));
    }
218792
public function getCurrent()
    {
        if (is_null($this->current))
        {
            $siteView = $this->makeNewViewModel();

            $this->current = $siteView;
        }

        return $this->current;
    }
96429
public function updateAction()
    {
        // Check current user authorization
        if (null !== $response = $this->checkAuth($this->resourceCode, $this->getModuleCode(), AccessManager::UPDATE)) {
            return $response;
        }

        // Load object if exist
        if (null !== $object = $this->getExistingObject()) {
            // Hydrate the form abd pass it to the parser
            $changeForm = $this->hydrateObjectForm($object);

            // Pass it to the parser
            $this->getParserContext()->addForm($changeForm);
        }

        // Render the edition template.
        return $this->renderEditionTemplate();
    }
1324389
public function viewAction()
    {
        $id = $this->params()->fromQuery('id');
        $channel = $this->params()->fromRoute('channel', 'default');
        $response = $this->getResponse();
        /* @var \Jobs\Entity\Job $job */
        try {
            $job = $this->initializeJob()->get($this->params(), true);
        } catch (NotFoundException $e) {
            $response->setStatusCode(Response::STATUS_CODE_404);
            return [
                'message' => sprintf($this->translator->translate('Job with id "%s" not found'), $id)
            ];
        }
        
        $mvcEvent             = $this->getEvent();
        $applicationViewModel = $mvcEvent->getViewModel();

        /* @var \Auth\Entity\User $user */
        $user = $this->auth()->getUser();

        /* @var \Zend\View\Model\ViewModel $model */
        $model = $this->viewModelTemplateFilter->getModel($job);

        if (
            Status::ACTIVE == $job->getStatus() or
            Status::WAITING_FOR_APPROVAL == $job->getStatus() or
            $job->getPermissions()->isGranted($user, PermissionsInterface::PERMISSION_VIEW) or
            $this->auth()->isAdmin()
        ) {
            $applicationViewModel->setTemplate('iframe/iFrameInjection');
        } elseif (Status::EXPIRED == $job->getStatus() or  Status::INACTIVE == $job->getStatus()) {
            $response->setStatusCode(Response::STATUS_CODE_410);
            $model->setTemplate('jobs/error/expired');
            $model->setVariables(
                [
                    'job'=>$job,
                    'message', 'the job posting you were trying to open, was inactivated or has expired'
                ]
            );
        } else {
            // there is a special handling for 404 in ZF2
            $response->setStatusCode(Response::STATUS_CODE_404);
            $model->setVariable('message', 'job is not available');
        }
        return $model;
    }
1045419
public function getFirstEditedNotSeen()
    {
        return $this
                ->hasOne(Post::className(), ['thread_id' => 'id'])
                ->where(['>', 'edited_at', $this->userView ? $this->userView->edited_last_seen : 0])
                ->orderBy(['id' => SORT_ASC]);
    }
529150
public function updateAction()
    {
        // Check current user authorization
        if (null !== $response = $this->checkAuth(static::CONTROLLER_CHECK_RESOURCE, Dealer::getModuleCode(),
                AccessManager::UPDATE)
        ) {
            return $response;
        }

        // Load object if exist
        if (null !== $object = $this->getExistingObject()) {
            // Hydrate the form abd pass it to the parser
            $changeForm = $this->hydrateObjectForm($object);

            // Pass it to the parser
            $this->getParserContext()->addForm($changeForm);
        }

        // Render the edition template.
        return $this->getEditRenderTemplate();
    }
1180587
public function index()
    {
        return view('eyewitness::dashboard.index')->withEye(app(Eye::class))
                                                  ->withTransformer(new ChartTransformer)
                                                  ->withNotifications(History::orderBy('acknowledged')->orderBy('created_at', 'desc')->get())
                                                  ->withStatuses(Statuses::all())
                                                  ->withQueues(Queue::all())
                                                  ->withSchedulers(Scheduler::all());
    }
1338762
public function getView() : View
    {
        if (empty($this->view)) {
            $this->setView(new AppView());
        }

        return $this->view;
    }
821583
public function index()
	{
		$posts = $this->posts->active(Config::get('core::wardrobe.per_page'));

		return View::make($this->theme.'.index', compact('posts'));
	}
256127
public function search()
    {
        $loggedId = User::loggedId();
        $query = Thread::find()->joinWith(['threadView' => function ($q) use ($loggedId) {
            $q->onCondition(['user_id' => $loggedId]);
            $q->andWhere(['or',
                    new Expression('new_last_seen < new_post_at'),
                    new Expression('edited_last_seen < edited_post_at'),
                    ['new_last_seen' => null],
                    ['edited_last_seen' => null],
                ]);
        }], false);

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'pagination' => [
                'defaultPageSize' => 10,
                'forcePageParam' => false
            ],
        ]);

        $dataProvider->sort->defaultOrder = ['edited_post_at' => SORT_ASC, 'id' => SORT_ASC];
        $dataProvider->pagination->pageSize = Yii::$app->session->get('per-page', 20);

        return $dataProvider;
    }
1308727
public function get_thread_data()
    {
        $data     = $this->get_tree();
        $depth    = array();
        $children = array();

        $this->build_thread_data($data, $depth, $children);

        return array($depth, $children);
    }
897199
protected function getThreadForGuests()
    {
        return $this->_query->joinWith([
                'forum' => function ($query) {
                    $query->andWhere([
                            Forum::tableName() . '.visible' => 1
                        ])->joinWith(['category' => function ($query) {
                            $query->andWhere([Category::tableName() . '.visible' => 1]);
                        }]);
                }
            ])->limit(1)->one();
    }