PHPackages                             ricasolucoes/tecnico - 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. [Admin Panels](/categories/admin)
4. /
5. ricasolucoes/tecnico

ActiveLibrary[Admin Panels](/categories/admin)

ricasolucoes/tecnico
====================

User to Group associations for the Laravel 5 Framework

0.4.4(2y ago)11MITPHPPHP ^7.2|^8.0

Since Oct 22Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/ricasolucoes/tecnico)[ Packagist](https://packagist.org/packages/ricasolucoes/tecnico)[ Docs](https://sierratecnologia.com/packages/tecnico/)[ RSS](/packages/ricasolucoes-tecnico/feed)WikiDiscussions stable Synced yesterday

READMEChangelogDependencies (15)Versions (10)Used By (0)

Tecnico
=======

[](#tecnico)

This package supports Laravel 6 and above.

[![Latest Version](https://camo.githubusercontent.com/4ab9f6e8345a1955decc88713e271cecfa2fd43f37be2c3c5f2d21e169e0e223/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72696361736f6c75636f65732f7465636e69636f2e737667)](https://github.com/ricasolucoes/tecnico/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://github.com/ricasolucoes/tecnico/workflows/run-tests/badge.svg)](https://github.com/ricasolucoes/tecnico/workflows/run-tests/badge.svg)[![codecov.io](https://camo.githubusercontent.com/51df1621d5e10e8b8a717af8a3008e2278f6f329d8890e0743c12ef6f97754dd/68747470733a2f2f636f6465636f762e696f2f6769746875622f72696361736f6c75636f65732f7465636e69636f2f636f7665726167652e7376673f6272616e63683d6d6173746572)](https://codecov.io/github/ricasolucoes/tecnico?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/c41ab05f2e10d3f16bd7d161548d60e1cbfb9fa88a544d1cbb9bd2cb2814d305/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f61326132366535352d626663372d343961392d393333622d3732636137633234353033342f6d696e692e706e67)](https://insight.sensiolabs.com/projects/a2a26e55-bfc7-49a9-933b-72ca7c245034)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a8481f25997817b8bef349dc5c476ea1f94eaa4b98f9c0bac46d8b1d4b25b7c5/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f72696361736f6c75636f65732f7465636e69636f2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ricasolucoes/tecnico/?branch=master)

Tecnico is the fastest and easiest method to add a User / Group association with Invites to your **Laravel 6+** project.

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

[](#installation)

```
composer require ricasolucoes/tecnico

```

The `Tecnico` Facade will be auto discovered by Laravel automatically.

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

[](#configuration)

To publish Tecnico's configuration and migration files, run the `vendor:publish` command.

```
php artisan vendor:publish --provider="Tecnico\TecnicoServiceProvider"
```

This will create a `tecnico.php` in your config directory. The default configuration should work just fine for you, but you can take a look at it, if you want to customize the table / model names Tecnico will use.

### User relation to groups

[](#user-relation-to-groups)

Run the `migration` command, to generate all tables needed for Tecnico. **If your users are stored in a different table other than `users` be sure to modify the published migration.**

```
php artisan migrate
```

After the migration, 3 new tables will be created:

- groups — stores group records
- group\_user — stores [many-to-many](http://laravel.com/docs/5.1/eloquent-relationships#many-to-many) relations between users and groups
- group\_invites — stores pending invites for email addresses to groups

You will also notice that a new column `current_group_id` has been added to your users table. This column will define the Group, the user is currently assigned to.

### Models

[](#models)

#### Group

[](#group)

Create a Group model inside `app/Group.php` using the following example:

```
