PHPackages                             uogsoe/hash-model-id - 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. uogsoe/hash-model-id

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

uogsoe/hash-model-id
====================

Very basic trait to add a HashID -&gt;id\_hash attribute to models

1.0.0(7y ago)05MITPHP

Since May 26Pushed 7y ago1 watchersCompare

[ Source](https://github.com/UoGSoE/hash-model-id)[ Packagist](https://packagist.org/packages/uogsoe/hash-model-id)[ RSS](/packages/uogsoe-hash-model-id/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Basic HashIds model attribute for Laravel
=========================================

[](#basic-hashids-model-attribute-for-laravel)

This package gives you a *very* basic trait which will return a 6+char [hashid](https://github.com/ivanakimov/hashids.php)for a $model-&gt;id\_hash attribute. It's primarily for our use when doing error reporting to minimise leaking 'real' ids. Eg, *could* be useful for GDPR purposes when reporting to a 3rd party service like [Rollbar](https://rollbar.com/).

The package is designed to be zero-config and simple to use - it's to cover our use-case of simply obfuscating the id's for reporting purposes. If you need something more configurable or secure - don't use it :-)

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

[](#installation)

```
composer require uogsoe/hash-model-id

```

Usage
-----

[](#usage)

In your model (usually your App\\User) add the `CanHashUserIds` trait :

```
