PHPackages                             elliottlan/laravel-baser - 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. elliottlan/laravel-baser

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

elliottlan/laravel-baser
========================

Encode and decode integers with your own specified base!

1.2(6mo ago)131MITPHPPHP &gt;=5.4.0

Since Mar 8Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/ElliottLandsborough/Laravel-Base-Encode)[ Packagist](https://packagist.org/packages/elliottlan/laravel-baser)[ RSS](/packages/elliottlan-laravel-baser/feed)WikiDiscussions main Synced 1mo ago

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

Laravel Baser
=============

[](#laravel-baser)

### Base encode and decode integers with your own specified base

[](#base-encode-and-decode-integers-with-your-own-specified-base)

[View the package](https://packagist.org/packages/elliottlan/laravel-baser) at packagist.org

#### Requirements

[](#requirements)

- Laravel
- PHP

#### Limits

[](#limits)

- Currently only supports integers from 1 to 100000000000000000000000000000 (on 64 bit machines)

#### Installation

[](#installation)

1. Include the composer package

```
composer require elliottlan/laravel-baser

```

2. Add this line to 'Providers' in config/app.php

```
Elliottlan\LaravelBaser\LaravelBaserServiceProvider::class,

```

3. Add this line to 'Aliases' in config/app.php

```
'Baser' => Elliottlan\LaravelBaser\Facades\Baser::class,

```

4. Use 'Base' at the top of a controller

```
use Baser;

```

5. Try an example out

```
echo Baser::getTokenFromInt(436432278698); // 7GnTmBA

```

#### Usage examples

[](#usage-examples)

##### Encode an int

[](#encode-an-int)

```
echo Baser::getTokenFromInt(436432278698); // 7GnTmBA
```

##### Decode a token

[](#decode-a-token)

```
echo Baser::getIntFromToken('7GnTmBA'); // 436432278698
```

##### Use big maths (requires php-bcmath)

[](#use-big-maths-requires-php-bcmath)

```
// calculate above the 32bit limit on old machines
echo Baser::bcMath()->getTokenFromInt(19598531548); // lolrly
echo Baser::bcMath()->getIntFromToken('lolrly'); // 19598531548
```

##### Define a codeset and encode/decode

[](#define-a-codeset-and-encodedecode)

```
// set codeset to 'ABCEFGHKMNPRSTUVW1235789'
echo Baser::setCodeset('ABCEFGHKMNPRSTUVW1235789')->getTokenFromInt(646464); // B82MA
echo Baser::setCodeset('ABCEFGHKMNPRSTUVW1235789')->getIntFromToken('B82MA'); // 646464
```

##### Everything

[](#everything)

```
echo Baser::setCodeset('ABC')->bcMath()->getTokenFromInt(1337);
```

##### Simple URL Shortening service using this package

[](#simple-url-shortening-service-using-this-package)

[Controller](https://github.com/ElliottLandsborough/Laravel-5-URL-Shorterner/blob/master/app/Http/Controllers/UrlController.php)[Model](https://github.com/ElliottLandsborough/Laravel-5-URL-Shorterner/blob/master/app/Url.php)[Migration](https://github.com/ElliottLandsborough/Laravel-5-URL-Shorterner/blob/master/database/migrations/2015_02_13_221304_create_url_table.php)

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance77

Regular maintenance activity

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~1298 days

Total

4

Last Release

187d ago

Major Versions

0.0.1 → 1.02015-03-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/158f6ef8dddd4a0d7c48ba910181ef4a4b4e8f34b290bb3408a4a81da465243c?d=identicon)[elliottlan](/maintainers/elliottlan)

---

Top Contributors

[![ElliottLandsborough](https://avatars.githubusercontent.com/u/1583854?v=4)](https://github.com/ElliottLandsborough "ElliottLandsborough (6 commits)")

---

Tags

laravelencodebase

### Embed Badge

![Health badge](/badges/elliottlan-laravel-baser/health.svg)

```
[![Health](https://phpackages.com/badges/elliottlan-laravel-baser/health.svg)](https://phpackages.com/packages/elliottlan-laravel-baser)
```

###  Alternatives

[barryvdh/laravel-ide-helper

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

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[torann/hashids

Laravel package for Hashids

54335.1k](/packages/torann-hashids)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

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