PHPackages                             kbs1/laravel-abbreviations - 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. kbs1/laravel-abbreviations

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

kbs1/laravel-abbreviations
==========================

Abbreviations / acronyms support for your app.

v1.0(8y ago)1018.6k↓25%MITPHPPHP &gt;=7.0

Since Jul 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/kbs1/laravel-abbreviations)[ Packagist](https://packagist.org/packages/kbs1/laravel-abbreviations)[ RSS](/packages/kbs1-laravel-abbreviations/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Laravel abbreviations
=====================

[](#laravel-abbreviations)

Simply create human-readable abbreviations / acronyms for any model, or abbreviations / acronyms in general.

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

[](#installation)

This package supports auto discovery. For laravel versions &lt; 5.5, add the following line in `config/app.php` providers section:

```
Kbs1\Abbreviations\AbbreviationsServiceProvider::class,

```

Add the following line in `config/app.php` aliases section:

```
'Abbreviation' => Kbs1\Abbreviations\Abbreviation::class,

```

Usage
-----

[](#usage)

In laravel models, use the following trait:

```
use \Kbs1\Abbreviations\HasAbbreviation;

```

Now you can get model's abbreviation simply by getting the `$model->abbreviation` attribute.

Customising the abbreviated attribute
-------------------------------------

[](#customising-the-abbreviated-attribute)

Trait by default uses the `name` attribute of a model. You can override this behavior by overriding the `abbreviationAttribute` method in your model code.

Generic abbreviations / acronyms
--------------------------------

[](#generic-abbreviations--acronyms)

Anywhere in your application, you can call `Abbreviation::make($string)` or `abbreviate($string)` helper to generate abbreviations on the fly.

Configuration
-------------

[](#configuration)

After publishing the config with `php artisan vendor:publish --tag=abbreviations`, you can define maximum generated abbreviations length (default `3`), generated abbreviations case (`uppercase`, `lowercase` or `original`), whether you prefer to include digits in generated abbreviations (default `false`), and whether to remove existing abbreviations from source string before processing (default `true`).

See comments in published configuration file for further details.

Examples
--------

[](#examples)

Using default configuration:

- `abbreviate('somestring') == 'SOM'`
- `abbreviate('somestring w/ meaning') == 'SM'`
- `abbreviate('somestring w/o meaning') == 'SM'`
- `abbreviate('somestring incl. others') == 'SO'`
- `abbreviate('Ing. Name Surname, PhD.') == 'NS'`
- `abbreviate('[7] => somestring') == 'SOM'`
- `abbreviate('K-9 mail widget') == 'KMW'`
- `abbreviate('GPSLoc') == 'GL'`
- `abbreviate('14Logistics internal system') == 'LIS'`
- `abbreviate('#1411: fix fooBar status') == 'FFB'`
- `abbreviate('#1234: deploy') == 'DEP'`
- `abbreviate('#1234:777: 500 words 7 characters long') == 'WCL'`
- `abbreviate('#1234:777: 500 words 700b') == 'WB'`
- `abbreviate('#1234:777: 500') == '#12'`
- `abbreviate('123456abcde') == 'ABC'`

Allowing digits:

- `abbreviate('K-9 mail widget') == 'KMW'` (non digit matching is always preferred)
- `abbreviate('[7] => somestring') == '7S'`
- `abbreviate('#1234: deploy') == '1D'`
- `abbreviate('#1234:777: 500 words 700b') == '175'`
- `abbreviate('#1234:777: 500') == '175'`
- `abbreviate('123456abcde') == '123'`

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3222d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/304075fab8f2b125a593547d7fdc1b9b6ed3e69fccdc8f41f5cf90fb59506aa5?d=identicon)[kbs1](/maintainers/kbs1)

---

Top Contributors

[![kbs1](https://avatars.githubusercontent.com/u/624162?v=4)](https://github.com/kbs1 "kbs1 (17 commits)")

---

Tags

abbreviationsacronymslaravellaravel-5-package

### Embed Badge

![Health badge](/badges/kbs1-laravel-abbreviations/health.svg)

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

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[wnx/laravel-stats

Get insights about your Laravel Project

1.8k1.8M7](/packages/wnx-laravel-stats)[php-mqtt/laravel-client

A wrapper for the php-mqtt/client library for Laravel.

228539.3k1](/packages/php-mqtt-laravel-client)[pdmfc/nova-info-card

A Laravel Nova info card.

14103.0k2](/packages/pdmfc-nova-info-card)

PHPackages © 2026

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