Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Lottoclient Bundle Laravel Package

dwr/lottoclient-bundle

View on GitHub
Deep Wiki
Context7

SensioLabsInsight

Build Status Scrutinizer Code Quality

DwrLottoClient

This bundle helps to take results from polish national lottery

Installation

Installation is a quick 3 steps process:

  1. Download DwrLottoClientBundle using composer.
  2. Enable the Bundle.
  3. Use bundle in your controller.

Step 1: Download DwrAvatarBundle using composer

Add DwrGlobalWeatherBundle in your composer.json:

{
    "require": {
        "dwr/lottoclient-bundle": "1.0"
    }
}

Download the bundle by running the command:

$ php composer.phar require dwr/lottoclient-bundle

Composer will install the bundle into your project's vendor/dwr/lottoclient-bundle directory.

Step 2: Enable the bundle

Enable the bundle in the kernel:

//app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Dwr\LottoClientBundle\DwrLottoClientBundle(),
    );
}

Step 3: Use bundle in your controller

    
    use Dwr\LottoClientBundle\Service\LottoClient; //don't forget add this line above class declaration
   

    /**
     * @Route("/", name="homepage")
     */
    public function indexAction()
    {

        $lotto = $this->get('dwr_lotto_client');
        $resultsDL = $lotto->getRecentlyResults(LottoClient::DUZY_LOTEK, 1); //takes last result from Duży lotek
        $resultsK  = $lotto->getRecentlyResults(LottoClient::KASKADA, 5); //takes 5 recently results from Kaskada
        
        var_dump($resultsDL);
        var_dump($resultsK);

        $date = new \DateTime('2014-10-10');
        $resultMINI = $lotto->getResultsByDate($date, LottoClient::MINI_LOTEK, 2); //takes 2 recently results from giving date for Mini Lotek
        $resultMULTI = $lotto->getResultsByDate($date, LottoClient::MULTI_LOTEK, 3); //takes 3 recently results from giving date for Multi Lotek

        var_dump($resultMINI);
        var_dump($resultMULTI);

        return $this->render('default/index.html.twig');
    }

Congratulations! You're ready to embed lotto results in your symfony2 application.

Usage

Add this in your controller:


    use Dwr\LottoClientBundle\Service\LottoClient; //don't forget add this line above class declaration

    /**
     * @Route("/", name="homepage")
     */
    public function indexAction()
    {

        $lotto = $this->get('dwr_lotto_client');
        
        /**
         * In order to take last result from Duży lotek pass 1 as a second argument for getRecentlyResults method.
         * Maximum you can take 10 recently results.
         */
        $resultsDL = $lotto->getRecentlyResults(LottoClient::DUZY_LOTEK, 1);
        var_dump($resultsDL); 
        
        /**
         * In order to take archive results use getResultsByDate method.
         * Specify date (e.g. new \DateTime('2014-10-10')) and pass it as first argument.
         */
        $date = new \DateTime('2014-10-10');
        $resultMINI = $lotto->getResultsByDate($date, LottoClient::MINI_LOTEK, 2);
        var_dump($resultMINI);
    }

Available lottery types:

LottoClient::DUZY_LOTEK
LottoClient::MINI_LOTEK
LottoClient::MULTI_LOTEK
LottoClient::JOKER
LottoClient::KASKADA

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings