PHPackages                             kletellier/lara-random - 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. kletellier/lara-random

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

kletellier/lara-random
======================

Laravel wrapper for ircmaxell/RandomLib

1.1(2y ago)0191MITPHPPHP ^8.1

Since May 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/kletellier/lara-random)[ Packagist](https://packagist.org/packages/kletellier/lara-random)[ RSS](/packages/kletellier-lara-random/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Laravel wrapper for icrmaxell/RandomLib
=======================================

[](#laravel-wrapper-for-icrmaxellrandomlib)

This package provides a Laravel wrapper Facade for [RandomLib](https://github.com/ircmaxell/RandomLib).

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

[](#installation)

The package can be installed via composer

```
$ composer require kletellier/lara-random
```

*\[If you are using Laravel with auto-discovery, you can skip this step\]* Then, add the service provider to your config/app.php file:

```
// config/app.php

'providers' => [
    ...
    Kletellier\Random\RandomServiceProvider::class,
    ...
];
```

*\[If you are using Laravelwith auto-discovery, you can skip this step\]* If you want to use the facade, add this:

```
// config/app.php

'aliases' => [
	  ...
        'Random' => Kletellier\Random\RandomFacade::class
    ...
]
```

This package comes with a config file, where you can define the generator strength.

```
php artisan vendor:publish --provider="Kletellier\Random\RandomServiceProvider"
```

Usage
-----

[](#usage)

```
// Generate a random string that is 64 bytes in length.
$string = Random::generate(64);

// Generate a whole number between 0 and 100.
$int = Random::generateInt(0, 100);

// Generate a 64 character string.
$string = Random::generateString(64);
```

#### Random::generate($size)

[](#randomgeneratesize)

Generate a random byte string of the requested size.

#### Random::generateInt($min = 0, $max = PHP\_INT\_MAX)

[](#randomgenerateintmin--0-max--php_int_max)

Generate a random integer with the given range. If range (`$max - $min`) is zero, `$max` will be used.

#### Random::generateString($length, $characters = '')

[](#randomgeneratestringlength-characters--)

Generate a random string of specified length.

This uses the supplied character list for generating the new result string. The list of characters should be specified as a string containing each allowed character.

If no character list is specified, the following list of characters is used:

```
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/

```

License
-------

[](#license)

This library is licensed under the MIT license. Please see [License file](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

2

Last Release

1084d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d7330f66fbcc03e1ae70ce113f19239a7a9849c5fc11055728ed547a9432c0d2?d=identicon)[kletellier](/maintainers/kletellier)

---

Top Contributors

[![kletellier](https://avatars.githubusercontent.com/u/8279846?v=4)](https://github.com/kletellier "kletellier (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kletellier-lara-random/health.svg)

```
[![Health](https://phpackages.com/badges/kletellier-lara-random/health.svg)](https://phpackages.com/packages/kletellier-lara-random)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M683](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M157](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M210](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M858](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
