PHPackages                             vegvisir/laratrust-cli - 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. [CLI &amp; Console](/categories/cli)
4. /
5. vegvisir/laratrust-cli

ActiveLibrary[CLI &amp; Console](/categories/cli)

vegvisir/laratrust-cli
======================

Command-line interface for Laratrust

0.1.3(7y ago)012GPL-3.0-or-laterPHP

Since Dec 14Pushed 7y agoCompare

[ Source](https://github.com/vegvisir-for-all/laratrust-cli)[ Packagist](https://packagist.org/packages/vegvisir/laratrust-cli)[ Docs](https://github.com/vegvisir-for-all/laratrust-cli)[ RSS](/packages/vegvisir-laratrust-cli/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

Laratrust CLI
=============

[](#laratrust-cli)

[![Latest Stable Version](https://camo.githubusercontent.com/2e05186c5a94ce2458d189d68ae0273261fac2b0896ae660b6e969d1dd79994e/68747470733a2f2f706f7365722e707567782e6f72672f76656776697369722f6c61726174727573742d636c692f762f737461626c65)](https://packagist.org/packages/vegvisir/laratrust-cli)[![Total Downloads](https://camo.githubusercontent.com/ca6ef01eec1398cd639a972f5aebd53491bd2da8c94494d70dfc45eb4413a758/68747470733a2f2f706f7365722e707567782e6f72672f76656776697369722f6c61726174727573742d636c692f646f776e6c6f616473)](https://packagist.org/packages/vegvisir/laratrust-cli)[![StyleCI](https://camo.githubusercontent.com/6f1f99cce7915c6a401007104b0352166ec070d5251b7bca785a7573f5214d20/68747470733a2f2f7374796c6563692e696f2f7265706f732f3136313735373931332f736869656c64)](https://styleci.io/repos/161757913)[![License](https://camo.githubusercontent.com/d28134a52daff685f4dd141a7c3b153feaf974ccc570bd0671adfcf98f1ffa41/68747470733a2f2f706f7365722e707567782e6f72672f76656776697369722f6c61726174727573742d636c692f6c6963656e7365)](https://packagist.org/packages/vegvisir/laratrust-cli)

Provides a command line interface for [Laratrust](https://github.com/santigarcor/laratrust) (CLI). Inspired by [entrust-cli](https://github.com/LinearSoft/entrust-cli).

Requirements
------------

[](#requirements)

You must have Laratrust installed, configured, and working, with database migrated and whatsoever. A good documentation on how to start with Laratrust can be found at .

Good news is that Laratrust CLI is compatible also with Team functionality of the Laratrust package.

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

[](#installation)

```
$ composer require vegvisir/laratrust-cli
```

### 4. Add service provider (Laravel &lt;5.5)

[](#4-add-service-provider-laravel-55)

If you're using Laravel up to 5.4.\*, you need to add service provider in the `providers` section of `config/app.php`:

```
Vegvisir\LaratrustCli\LaratrustCliServiceProvider::class,
```

### 5. Publish config file

[](#5-publish-config-file)

```
$ artisan vendor:publish
```

Usage
-----

[](#usage)

Laratrust CLI add the folowing artisan commands:

```
$ artisan list
...
 laratrust-cli
  laratrust-cli:permission:attach  Attach permision to Laratrust role
  laratrust-cli:permission:create  Create a Laratrust permission
  laratrust-cli:permission:delete  Delete a Laratrust permission
  laratrust-cli:permission:detach  Detach permision from Laratrust role
  laratrust-cli:permission:list    Lists all Laratrust permissions
  laratrust-cli:role:attach        Add a Laratrust role to a user
  laratrust-cli:role:create        Create a Laratrust role
  laratrust-cli:role:delete        Delete a Laratrust role
  laratrust-cli:role:detach        Detach a Laratrust role from a user
  laratrust-cli:role:list          Lists all Laratrust roles
  laratrust-cli:team:attach        Add a Laratrust role to a user within a team
  laratrust-cli:team:create        Create a Laratrust team
  laratrust-cli:team:delete        Delete a Laratrust team
  laratrust-cli:team:detach        Detach a Laratrust role from a user within a team
  laratrust-cli:team:list          Lists all Laratrust teams
...
```

CommandActionParametersExample`*:create`Creates a role/permission/teamname \[display name\] \[description\]`laratrust-cli:role:create myrole "My Role"``*:delete`Deletes a role/permission/teamname`laratrust-cli:permission:delete perm1``*:list`Lists all roles/permissions/teams*none*`laratrust-cli:role:list``permission:attach`Attaches a permission to a rolepermission\_name role\_name`laratrust-cli:permission:attach perm1 myrole``permission:detach`Detaches a permission from a rolepermission\_name role\_name`laratrust-cli:permission:detach perm1 myrole``role:attach`Attaches a role to a userrole\_name email`laratrust-cli:role:attach myrole user2@gmail.com``role:detach`Detaches a role from a userrole\_name email`laratrust-cli:role:detach myrole user2``team:create`Creates a teamname`laratrust-cli:team:create myteam``team:delete`Deleted a teamname`laratrust-cli:team:delete myteam`### Team functionality

[](#team-functionality)

All `laratrust-cli:team:*` commands will not run unless team functionality is turned on in the Laratrust configuration. Please refer to [Laratrust documentation](https://laratrust.readthedocs.io/en/4.0/usage/concepts.html#teams) to discover more about team functionality.

### User identity

[](#user-identity)

Unlike `entrust-cli`, Laratrust CLI looks up for users **only** by e-mail address. However, we intend to extend the functionality of user identification to custom attributes in the future (like in `entrust-cli`).

### User model (Eloquent/MongoDB)

[](#user-model-eloquentmongodb)

Since we develop this package within an application that utilizes Laratrust with [jenssegers/laravel-mongodb](https://github.com/jenssegers/laravel-mongodb), there's a possibility to use it with `jenssegers/laravel-mongodb` ORM.

In the `config/laratrust-cli.php` you need to set `user_model` as `\Vegvisir\LaratrustCli\Models\User\UserJenssegersMongodb`:

```
...
'user_model' => '\Vegvisir\LaratrustCli\Models\User\UserJenssegersMongodb'
...
```

Don't forget to clear your config cache after changing of the configuration:

```
$ artisan config:clear
```

About
-----

[](#about)

### Vegvisir

[](#vegvisir)

We're a small development team from Warsaw, Poland, looking to work remotely on your projects!

### Bug reporting

[](#bug-reporting)

Please submit all bugs and issues via [GitHub](https://github.com/vegvisir-for-all/laratrust-cli/issues). All feedback will be more than welcome!

### Licence

[](#licence)

Laratrust CLI is licensed under the GPLv3 License. See the `LICENSE` file for details.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

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

Total

4

Last Release

2708d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/755a37309b080e0f0d90ede46629056c3f7878613eaac93b7549d33f2a93618e?d=identicon)[vegvisir](/maintainers/vegvisir)

---

Top Contributors

[![vegvisir-for-all](https://avatars.githubusercontent.com/u/45864732?v=4)](https://github.com/vegvisir-for-all "vegvisir-for-all (4 commits)")

---

Tags

cliconsolelaravelauthaclrolespermissionslaratrust

### Embed Badge

![Health badge](/badges/vegvisir-laratrust-cli/health.svg)

```
[![Health](https://phpackages.com/badges/vegvisir-laratrust-cli/health.svg)](https://phpackages.com/packages/vegvisir-laratrust-cli)
```

###  Alternatives

[kodeine/laravel-acl

Light-weight role-based permissions for Laravel 5 built in Auth system.

782354.8k5](/packages/kodeine-laravel-acl)[phpzen/laravel-rbac

Role based access control for Laravel 5

383.2k](/packages/phpzen-laravel-rbac)

PHPackages © 2026

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