PHPackages                             liviu-hariton/loto-ro - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. liviu-hariton/loto-ro

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

liviu-hariton/loto-ro
=====================

A Laravel package that fetches the Romanian lottery history for the 6/49 and 5/40 draws

v0.1.1(1y ago)03MITPHPPHP ^8.3

Since Feb 2Pushed 1y ago1 watchersCompare

[ Source](https://github.com/liviu-hariton/loto-ro)[ Packagist](https://packagist.org/packages/liviu-hariton/loto-ro)[ RSS](/packages/liviu-hariton-loto-ro/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

LotoRo - Romanian Lottery Results for Laravel
=============================================

[](#lotoro---romanian-lottery-results-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3bc0f999af13c1280ca3384ef14043148b41bd94387c170aa19b58d3c71e4a1f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c697669752d68617269746f6e2f6c6f746f2d726f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/liviu-hariton/loto-ro)[![](https://camo.githubusercontent.com/85f32975abf6e652abd9caa8fb5260f4ee6c3339207d9aa207f91293cd955820/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31312d6634363435662e737667)](https://github.com/laravel)[![Total Downloads](https://camo.githubusercontent.com/00c6ed5c8b13dc65f69f14fe9cb3ac210fbf6670faeeb61ea3b6b409d9159ceb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c697669752d68617269746f6e2f6c6f746f2d726f2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/liviu-hariton/loto-ro)[![](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565)](https://github.com/liviu-hariton/loto-ro/blob/main/LICENSE.md)

LotoRo is a Laravel package that automates the retrieval, processing, and storage of Romanian lottery results for the 6/49 and 5/40 draw types. The package fetches official draw data, extracts winning numbers and prize distributions, and provides structured access to historical lottery results via an API and CLI commands.

### Key Features

[](#key-features)

- Fetches **6/49** and **5/40** lottery results from official sources
- Parses and stores draw dates, numbers, categories, and prize distributions
- Provides **API endpoints** to retrieve the most and least drawn numbers
- Offers **CLI commands** to fetch results efficiently
- Supports filtering by **date range** and **draw type**
- Includes **denomination adjustments** for pre-2005 Romanian LEU values

### Ideal For

[](#ideal-for)

- Developers needing **structured lottery data**
- Analysts tracking **number frequencies** and **historical trends**
- Websites displaying **Romanian lottery results**

Table of Contents
-----------------

[](#table-of-contents)

- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
    - [CLI Commands](#cli-commands)
        - [Fetch Lottery Results](#fetch-lottery-results)
        - [Export Lottery Results](#export-lottery-results)
    - [API Endpoints](#api-endpoints)
        - [Fetch the lottery results from the source](#fetch-the-lottery-results-from-the-source)
        - [Export the lottery results](#export-the-lottery-results)
        - [Get the draw dates](#get-the-draw-dates)
        - [Get the draw data](#get-the-draw-data)
        - [Get the most drawn numbers](#get-the-most-drawn-numbers)
        - [Get the least drawn numbers](#get-the-least-drawn-numbers)
        - [Get the prizes distribution](#get-the-prizes-distribution)
        - [Get the total prize fund](#get-the-total-prize-fund)
        - [Get the total winners](#get-the-total-winners)
        - [Get not drawn numbers](#get-not-drawn-numbers)
        - [Generate random numbers](#generate-random-numbers)
    - [Custom Controllers](#custom-controllers)
- [Uninstallation](#uninstallation)
- [License](#license)
- [Disclaimer](#disclaimer)
- [Gambling problems](#the-gambling-problems-can-be-solved)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.3
- [Laravel](https://github.com/laravel/laravel) &gt;= 11.0
- ext-dom PHP extension
    - it provides access to the [DOMDocument](https://www.php.net/manual/en/class.domdocument.php) and [DOMXPath](https://www.php.net/manual/en/class.domxpath.php) classes

Installation
------------

[](#installation)

You can install the **LotoRo Laravel package** via Composer. Run the following command in your terminal:

```
composer require liviu-hariton/loto-ro
```

Laravel will automatically register the package.

Publish and run the package migrations with the following commands:

```
php artisan vendor:publish --tag="loto-ro-migrations"
php artisan migrate
```

The migrations will create the following tables in your database: `lotoro_draws`, `lotoro_results` and `lotoro_totals`.

Run the installation command to chose how the routes should be registered:

```
php artisan lotoro:install
```

First, you will be asked if you want to automatically register the default routes. If you chose `no`, you'll have the option to publish them in the next question. If you chose to publish the routes, you'll find them in the `routes` directory of your Laravel application, in the `lotoro_routes.php` file.

Otherwise, you can manually register the routes in your `routes/web.php` or `routes/api.php` (learn more about the [Laravel API Routes](https://laravel.com/docs/11.x/routing#api-routes)) file:

```
