PHPackages                             divineomega/thisishowirole - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. divineomega/thisishowirole

Abandoned → [jord-jd/thisishowirole](/?search=jord-jd%2Fthisishowirole)Library[Authentication &amp; Authorization](/categories/authentication)

divineomega/thisishowirole
==========================

'This Is How I Role' is a PHP role management system that can be applied to any class.

v4.0.0(2mo ago)1154↓100%2[1 issues](https://github.com/Jord-JD/ThisIsHowIRole/issues)LGPL-3.0-onlyPHPPHP &gt;=5.5.9

Since Jul 18Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/Jord-JD/ThisIsHowIRole)[ Packagist](https://packagist.org/packages/divineomega/thisishowirole)[ GitHub Sponsors](https://github.com/DivineOmega)[ RSS](/packages/divineomega-thisishowirole/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (1)Versions (21)Used By (0)

This Is How I Role (TIHIR)
==========================

[](#this-is-how-i-role-tihir)

'This Is How I Role' is a PHP role management system that can be applied to any class.

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

[](#installation)

You can use `composer` to install this package. Just run `composer require jord-jd/thisishowirole`.

Setup
-----

[](#setup)

### Table creation

[](#table-creation)

First, create a new table in your application's database to store the TIHIR roles. You can use the following SQL snippet to create the table.

```
CREATE TABLE IF NOT EXISTS `tihir_roles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `class_name` varchar(1000) NOT NULL,
  `foreign_id` bigint(20) NOT NULL,
  `roles` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
```

If you're using Laravel, you can use the following database migration to create the TIHIR roles table.

```
