Watch an item.

@param \Illuminate\Http\Request $request

@return \Illuminate\Http\RedirectResponse
515134
public static function endedAuctionsAdmin()
    {
        $items = Item::has('bids')
            ->where('auction', true)
            ->whereRaw('`reserve_price` <= `bidding_price`')
            ->where('user_ended', 0)
            ->where('winning_bid_id', 0)
            ->where('end_date', '<', time())
            ->get();

        foreach ($items as $item) {
            $item->end();

            $item->winningBid->bidder->sendEmail(
                'You won an item',
                'emails.item.won',
                [
                    'item_id'    => $item->itemId,
                    'item_name'  => $item->name,
                    'item_price' => $item->biddingPrice,
                    'bid_amount' => $item->winningBid->amount,
                    'bid_placed' => $item->winningBid->placed,
                ]
            );
        }
    }
1246983
public function send(Request $request)
    {
        $this->monitor->start($this->metricName, ['service_key' => $request->getServiceKey(), 'request_key' => $request->getRequestKey()]);
        $response = $this->sender->send($request);
        $this->monitor->end($this->metricName, ['response_status' => $response->getStatusCode()]);
        return $response;
    }
79180
public function update(Request $request)
    {
        $action = $request->input('action');

        $thread = $this->api("thread.{$action}", $request->route('thread'))->parameters($request->all())->patch();

        Forum::alert('success', 'threads.updated', 1);

        return redirect(Forum::route('thread.show', $thread));
    }
778884
public function redirect(Request $request)
    {
        $provider = $request->get('provider');

        if ($provider === null) {
            throw new HttpException(500, 'provider necessary');
        }

        return \Socialize::with($provider)->redirect();
    }
769004
public function indexAction(Request $request)
    {
        /** @var RedirectionRepository $errorRepository */
        $redirectionRepository = $this->getDoctrine()->getManager()->getRepository('VictoireSeoBundle:Redirection');

        // Fetch errors

        /** @var QueryBuilder $redirections */
        $redirections = $redirectionRepository->getUnresolvedQuery()->getQuery()->getResult();

        // Build forms

        $forms = [];

        /** @var Redirection[] $redirection */
        foreach ($redirections as $redirection) {
            $forms[$redirection->getId()] = $this->getRedirectionForm($redirection,
                sprintf('#redirection-%d-item-container', $redirection->getId())
            )->createView();
        }

        $newForm = $this->getRedirectionForm(new Redirection(), '#new-redirection-form-container')->createView();

        // Return datas

        return new Response($this->renderView('@VictoireSeo/Redirection/index.html.twig', [
            'newForm'      => $newForm,
            'redirections' => $redirections,
            'forms'        => $forms,
        ]));
    }
1098013
public function postLogin(Request $request)
    {

        $this->validate($request, ['username' => 'required|min:3|max:255', 'password' => 'required',]);

        $credentials = $request->only('username', 'password');
        $credentials[ 'enabled' ] = 1;

        if (Auth::attempt($credentials, $request->has('remember'))) {
            return redirect()->intended($this->getRedirectUrl());
        } else {
            return redirect(route('login'))->withInput($request->except(['password']))
                                           ->withErrors([$this->getFailedLoginMessage()]);
        }

    }
409517
public function indexAction(Request $request)
    {
        $dispatcher = $this->get('event_dispatcher');
        $event = new ResponseEvent($request);
        $dispatcher->dispatch(OpiferMediaEvents::MEDIA_CONTROLLER_INDEX, $event);

        if (null !== $event->getResponse()) {
            return $event->getResponse();
        }

        $providers = $this->get('opifer.media.provider.pool')->getProviders();

        return $this->render($this->container->getParameter('opifer_media.media_index_view'), [
            'providers' => $providers,
        ]);
    }
38986
public function indexAction(Request $request)
    {
        $response = new Response();
        try {
            $this->channelContext->getChannel();
        } catch (ChannelNotFoundException $e) {
            $response->headers->setCookie(new Cookie('_channel_code', $this->fallbackChannelCode));
            $request->query->set('_channel_code', $this->fallbackChannelCode);
        }

        return $this->templating->renderResponse('@SyliusShop/Homepage/index.html.twig', [], $response);
    }
1145843
public function show(Request $request)
    {
        // AUTHORIZE ... COMES HERE
        $pb = $this->pageblock->where('id', $request->get('pageblock_id'))->first();
        $pageblock = $this->pageBlockRepository->getRenderedByPageBlock($pageblock);
        return $pageblock;
    }
211225
public function run(Request $request) {
    // process the requested action
    ObjectFactory::getInstance('actionMapper')->processAction($request, $this->response);
    return $this->response;
  }
583732
public function register(Request $request)
    {
        $validator = $this->validator($request->all());

        if ($validator->fails()) {
            $this->throwValidationException($request, $validator);
        }

        $user = $this->create($request->all());

        $broker = $this->getBroker();

        $credentials = $request->only('email');

        Verification::broker($broker)->sendVerificationLink($credentials, function (Message $message) {
            $message->subject($this->getEmailSubject());
        });

        if (config('verification.verify')) {
            return redirect($this->verificationRedirectPath());
        }

        Auth::guard($this->getGuard())->login($user);

        return redirect($this->redirectPath());
    }
619910
public function index(Request $request)
    {
        $this->getFormRequestInstance();

        $items = $this->getItemsCollection();

        if ($request->wantsJson()) {
            return $this->validSuccessJsonResponse('Success', $items);
        }

        $view = $this->getViewLocation(__FUNCTION__);
        $this->checkViewExists($view);

        return response()->view($view, compact('items'));
    }
1092506
public function run(Request $request = null)
    {
        if (null === $request) {
            $request = Request::createFromGlobals();
        }

        $response = $this->handle($request);
        $response->send();

        return $response;
    }
55342
public function store(Request $request)
    {
        $request = $this->processRequest($request);

        if ($request === true) {
            return $this->redirection();
        }

        $this->validate($request, $this->model->rules());

        $this->model = $this->model->create($request->all());

        $saved = $this->afterSaving($request);

        if ($saved) {
            return $this->redirection();
        }
    }
193703
public function store(Request $request)
    {
        $this->validate($request, Role::$rules, Role::$messages);

        $this->createEntry(Role::class, $request->all());

        return redirect_to_resource();
    }
252189
public function showAction(Request $request)
    {
        $em = $this->getDoctrine()->getManager();
        /* @var $rep NoticeRepository */
        $rep = $em->getRepository('AnimeDbAppBundle:Notice');

        $notice = $rep->getFirstShow();
        // caching
        /* @var $response JsonResponse */
        $response = $this->getCacheTimeKeeper()->getResponse([], -1, new JsonResponse());
        $response->setEtag(md5($notice ? $notice->getId() : 0));
        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        // shown notice
        if (!is_null($notice)) {
            $notice->shown();
            $em->persist($notice);
            $em->flush();

            $response->setData([
                'notice' => $notice->getId(),
                'close' => $this->generateUrl('notice_close', ['id' => $notice->getId()]),
                'see_later' => $this->generateUrl('notice_see_later'),
                'content' => $this->renderView('AnimeDbAppBundle:Notice:show.html.twig', [
                    'notice' => $notice,
                    'link_all' => $request->query->getBoolean('all'),
                ]),
            ]);
        }

        return $response;
    }
1091694
public function handle(Request $request)
    {
        $annotationReader = new AnnotationReader();
        /** @var ApiRateLimit $annotation */
        $annotation = $annotationReader->getClassAnnotation(
            new ReflectionClass($request->attributes->get('_api_resource_class')),
            ApiRateLimit::class
        );

        if (null !== $annotation) {
            $this->enabled = $annotation->enabled;
        }

        list($key, $limit, $period) = $this->getThrottle($request, $annotation);

        if ($this->enabled) {
            $this->decreaseRateLimitRemaining($key, $limit, $period);
        }
    }