PHPackages                             litepie/teams - 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. litepie/teams

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

litepie/teams
=============

A modern, tenant-ready teams management package for Laravel 12+

v1.0.4(7mo ago)05MITPHPPHP ^8.2

Since Aug 23Pushed 6mo agoCompare

[ Source](https://github.com/Litepie/Teams)[ Packagist](https://packagist.org/packages/litepie/teams)[ Docs](https://github.com/Litepie/Teams)[ RSS](/packages/litepie-teams/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (16)Versions (6)Used By (0)

Lavalite Teams 🚀
================

[](#lavalite-teams-)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1881c6f480e56bf587d698527c6f23fc2417562058042ccddaa7bc8fa82d00fa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6974657069652f7465616d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/litepie/teams)[![GitHub Tests Action Status](https://camo.githubusercontent.com/9929b5f0e6a085137efe6ec887996041e2a4c14e2573e483d177e880bdd305f2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6974657069652f7465616d732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/litepie/teams/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/8d02715e5a6bbe75281c25515c23c1a9ec3261d0cc68bc9450f8e5eda061a2bd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6974657069652f7465616d732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/litepie/teams/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/b9c85b3128865c3d1ea027332296ee5d3bffb1cb78d21a52bf30cc9171719a95/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6974657069652f7465616d732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/litepie/teams)[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

A modern, tenant-ready teams management package for Laravel 12+ applications. Built for collaboration, scalability, and multi-tenancy from the ground up.

> **Note**: This package is part of the Litepie ecosystem and is open source under the MIT license. Perfect for SaaS applications, multi-tenant platforms, and collaborative tools.

✨ Features
----------

[](#-features)

- 🏢 **Multi-Tenant Ready**: Complete tenant isolation with [Litepie Tenancy](https://github.com/Litepie/Tenancy)
- 👥 **Team Management**: Create, manage, and organize teams with hierarchical structures
- � **Role-Based Access**: Built-in role and permission management system
- 🔄 **Workflow Integration**: Team workflows with [Litepie Flow](https://github.com/Litepie/Flow)
- ⚡ **Action Pattern**: Built on [Litepie Actions](https://github.com/Litepie/Actions) for clean business logic
- 📁 **File Management**: Team file sharing with [Litepie Filehub](https://github.com/Litepie/Filehub)
- 🚀 **Modern Laravel**: Laravel 12+ ready with PHP 8.2+ support
- 🎨 **Rich API**: RESTful API with comprehensive resources
- 📊 **Team Analytics**: Performance metrics and insights
- 🔔 **Real-time Events**: WebSocket support for live collaboration
- 🧪 **Fully Tested**: Comprehensive test suite with 95%+ coverage

📋 Table of Contents
-------------------

[](#-table-of-contents)

- [Installation](#installation)
- [Quick Start](#quick-start)
- [Configuration](#configuration)
- [Basic Usage](#basic-usage)
- [Multi-Tenant Usage](#multi-tenant-usage)
- [Workflows](#workflows)
- [Permissions &amp; Roles](#permissions--roles)
- [File Management](#file-management)
- [API Integration](#api-integration)
- [Events](#events)
- [Testing](#testing)
- [Roadmap](#roadmap)
- [Contributing](#contributing)
- [Changelog](#changelog)
- [Security](#security)
- [License](#license)

🚀 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require litepie/teams
```

Publish and run the migrations:

```
php artisan vendor:publish --tag="teams-migrations"
php artisan migrate
```

Publish the configuration file:

```
php artisan vendor:publish --tag="teams-config"
```

⚙️ Configuration
----------------

[](#️-configuration)

The configuration file `config/teams.php` provides extensive customization options:

```
return [
    'model' => [
        'team' => \Litepie\Teams\Models\Team::class,
        'team_member' => \Litepie\Teams\Models\TeamMember::class,
        'team_invitation' => \Litepie\Teams\Models\TeamInvitation::class,
    ],

    'features' => [
        'tenancy' => true,
        'workflows' => true,
        'file_management' => true,
        'real_time_events' => true,
        'team_analytics' => true,
    ],

    'permissions' => [
        'auto_create' => true,
        'middleware' => ['team.member'],
    ],

    'invitations' => [
        'expires_after_days' => 7,
        'max_pending_per_team' => 50,
    ],
];
```

🚀 Quick Start
-------------

[](#-quick-start)

### 1. Setup Your User Model

[](#1-setup-your-user-model)

Add the `HasTeams` trait to your User model:

```
use Litepie\Teams\Traits\HasTeams;

class User extends Authenticatable
{
    use HasTeams;

    // Your existing model code
}
```

### 2. Create Your First Team

[](#2-create-your-first-team)

```
use Litepie\Teams\Actions\CreateTeamAction;

$team = CreateTeamAction::execute(null, [
    'name' => 'Development Team',
    'description' => 'Our amazing development team',
    'type' => 'development',
    'settings' => [
        'visibility' => 'private',
        'features' => ['file_sharing', 'workflows'],
        'limits' => ['max_members' => 50],
    ],
], $user);
```

### 3. Add Team Members

[](#3-add-team-members)

```
use Litepie\Teams\Actions\AddTeamMemberAction;

// Add a member with specific role
AddTeamMemberAction::execute($team, [
    'user_id' => $user->id,
    'role' => 'member',
    'permissions' => ['view_team', 'create_posts'],
], $teamOwner);

// Invite via email
use Litepie\Teams\Actions\InviteTeamMemberAction;

InviteTeamMemberAction::execute($team, [
    'email' => 'newmember@example.com',
    'role' => 'member',
    'message' => 'Welcome to our team!',
], $teamOwner);
```

🏢 Multi-Tenant Usage
--------------------

[](#-multi-tenant-usage)

Teams seamlessly integrates with tenant-based applications:

```
// Set tenant context
tenancy()->initialize($tenant);

// All team operations are now scoped to the current tenant
$teams = Team::current()->get(); // Only returns current tenant's teams

// Create tenant-specific team
$team = CreateTeamAction::execute(null, [
    'name' => 'Tenant Development Team',
    'tenant_id' => tenancy()->current()?->id,
], $user);

// Team permissions are automatically tenant-scoped
$user->can('manage', $team); // Checks within current tenant context
```

🔄 Workflows
-----------

[](#-workflows)

Integrate team workflows for automated processes:

```
use Litepie\Teams\Workflows\TeamWorkflow;

// Team lifecycle workflow
$workflow = TeamWorkflow::create();

// Available states: draft, active, suspended, archived
// Available transitions: activate, suspend, archive, restore

// Transition team through workflow
$team->transitionTo('active', [
    'activated_by' => $user->id,
    'reason' => 'Team setup completed',
]);

// Check current state
if ($team->getCurrentState()->getName() === 'active') {
    // Team is active
}
```

� Permissions &amp; Roles
-------------------------

[](#-permissions--roles)

Teams provides a built-in role and permission management system:

```
// Team-level permissions
$team->addMember($user, 'admin');
$team->addMember($user, 'member');

// Check team-specific permissions
if ($team->userHasRole($user, 'admin')) {
    // User is an admin of this team
}

if ($team->userHasPermission($user, 'edit_team_settings')) {
    // User can edit team settings
}

// Update member role
$team->updateMemberRole($user, 'moderator');

// Update member permissions
$team->updateMemberPermissions($user, ['edit_content', 'manage_files']);
```

📁 File Management
-----------------

[](#-file-management)

Teams provides integrated file management through Litepie Filehub:

```
// Upload team files
$team->attachFile($request->file('document'), 'documents', [
    'uploader_id' => $user->id,
    'title' => 'Team Charter',
    'visibility' => 'team_members',
]);

// Get team files
$documents = $team->getFiles('documents');
$avatars = $team->getFiles('avatars');

// File permissions
$file = $team->getFirstFile('logo');
if ($user->can('download', $file)) {
    return $file->downloadResponse();
}
```

🌐 API Integration
-----------------

[](#-api-integration)

Teams provides a comprehensive RESTful API:

```
// API routes are automatically registered
Route::middleware(['api', 'tenant.required'])->group(function () {
    Route::apiResource('teams', TeamController::class);
    Route::apiResource('teams.members', TeamMemberController::class);
    Route::apiResource('teams.invitations', TeamInvitationController::class);
});

// API Resources
$team = Team::find(1);
return new TeamResource($team);
// Returns: team data with members, files, permissions, etc.
```

📊 Events
--------

[](#-events)

Teams fires comprehensive events for real-time features:

```
// Listen to team events
Event::listen(TeamCreated::class, function ($event) {
    // Send welcome notifications
    NotifyTeamCreated::dispatch($event->team);
});

Event::listen(MemberJoinedTeam::class, function ($event) {
    // Update team analytics
    UpdateTeamMetrics::dispatch($event->team);
});

// Real-time broadcasting
class MemberJoinedTeam implements ShouldBroadcast
{
    public function broadcastOn()
    {
        return new PrivateChannel("team.{$this->team->id}");
    }
}
```

🧪 Testing
---------

[](#-testing)

Teams includes comprehensive testing utilities:

```
use Litepie\Teams\Testing\TeamTestHelpers;

class TeamFeatureTest extends TestCase
{
    use TeamTestHelpers;

    public function test_user_can_create_team()
    {
        $user = User::factory()->create();
        $tenant = $this->createTenant();

        $this->actingAsTenant($tenant)
             ->actingAs($user);

        $team = $this->createTeam([
            'name' => 'Test Team',
            'owner_id' => $user->id,
        ]);

        $this->assertDatabaseHas('teams', [
            'name' => 'Test Team',
            'tenant_id' => $tenant->id,
        ]);

        $this->assertTrue($user->ownsTeam($team));
    }
}
```

📈 Advanced Features
-------------------

[](#-advanced-features)

### Team Analytics

[](#team-analytics)

```
use Litepie\Teams\Analytics\TeamAnalytics;

$analytics = TeamAnalytics::for($team)
    ->period('last_30_days')
    ->metrics(['activity', 'files', 'members'])
    ->get();

// Get insights
$insights = $team->getAnalytics([
    'member_activity' => true,
    'file_usage' => true,
    'collaboration_metrics' => true,
]);
```

### Team Templates

[](#team-templates)

```
use Litepie\Teams\Templates\TeamTemplate;

// Create team from template
$template = TeamTemplate::find('development_team');
$team = $template->createTeam([
    'name' => 'New Dev Team',
    'owner_id' => $user->id,
]);

// Templates include predefined roles, permissions, and workflows
```

### Bulk Operations

[](#bulk-operations)

```
use Litepie\Teams\Actions\BulkTeamOperationsAction;

// Bulk member operations
BulkTeamOperationsAction::execute($team, [
    'operation' => 'add_members',
    'users' => [$user1->id, $user2->id, $user3->id],
    'role' => 'member',
]);

// Bulk permission updates
BulkTeamOperationsAction::execute($team, [
    'operation' => 'update_permissions',
    'members' => [$user1->id, $user2->id],
    'permissions' => ['edit_content', 'manage_files'],
]);
```

🗺️ Roadmap
----------

[](#️-roadmap)

We're continuously improving Lavalite Teams. Here's what's coming next:

### 🚀 Upcoming Features (v2.1)

[](#-upcoming-features-v21)

- Team templates and blueprints
- Advanced team analytics dashboard
- Integration with popular project management tools
- Team chat integration
- Mobile SDK for teams

### 🔮 Future Releases (v2.2+)

[](#-future-releases-v22)

- AI-powered team insights
- Advanced workflow automation
- Team performance metrics
- Custom team widgets
- GraphQL API support

Want to contribute to these features? Check out our [contributing guide](#contributing)!

🤝 Contributing
--------------

[](#-contributing)

We love contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on:

- 🐛 **Bug Reports**: How to report bugs effectively
- 💡 **Feature Requests**: Proposing new features
- 🔧 **Pull Requests**: Code contribution guidelines
- 📝 **Documentation**: Improving our docs
- 🧪 **Testing**: Adding and running tests

### Development Setup

[](#development-setup)

1. **Fork and Clone**

    ```
    git clone https://github.com/your-username/teams.git
    cd teams
    ```
2. **Install Dependencies**

    ```
    composer install
    npm install
    ```
3. **Setup Testing Environment**

    ```
    cp .env.example .env
    php artisan key:generate
    php artisan migrate --env=testing
    ```
4. **Run Tests**

    ```
    composer test
    composer test:coverage
    ```

### Code Style

[](#code-style)

We follow PSR-12 coding standards:

```
composer format        # Fix code style
composer analyse       # Run static analysis
composer test:types    # Check type coverage
```

📋 Changelog
-----------

[](#-changelog)

Please see [CHANGELOG.md](CHANGELOG.md) for more information on what has changed recently.

Major releases and their highlights:

- **v2.0.0** - Multi-tenancy support, workflow integration
- **v1.5.0** - File management, advanced permissions
- **v1.0.0** - Initial stable release

🔒 Security
----------

[](#-security)

If you discover any security-related issues, please email  instead of using the issue tracker. All security vulnerabilities will be promptly addressed.

### Security Features

[](#security-features)

- 🛡️ **Tenant Isolation**: Complete data separation between tenants
- 🔐 **Permission System**: Granular role-based access control
- 🔍 **Audit Logging**: Complete activity tracking
- 🚫 **Input Validation**: Comprehensive request validation
- 🔒 **File Security**: Secure file uploads and access controls

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

This package is open source software licensed under the [MIT license](https://opensource.org/licenses/MIT).

🙏 Credits
---------

[](#-credits)

- **Created by**: [Renfos Technologies](https://renfos.com)
- **Maintained by**: [Litepie Development Team](https://github.com/litepie)
- **Contributors**: [All Contributors](../../contributors)

Special thanks to all the developers who have contributed to making this package better!

📞 Support &amp; Community
-------------------------

[](#-support--community)

- **📖 Documentation**: [teams.litepie.com](https://teams.litepie.com)
- **🐛 Bug Reports**: [GitHub Issues](https://github.com/litepie/teams/issues)
- **💬 Discussions**: [GitHub Discussions](https://github.com/litepie/teams/discussions)
- **📧 Email Support**:
- **💼 Commercial Support**: [Contact Us](https://renfos.com/contact)

### Community Guidelines

[](#community-guidelines)

Please be respectful and constructive in all interactions. See our [Code of Conduct](CODE_OF_CONDUCT.md) for more details.

🌟 Sponsors
----------

[](#-sponsors)

This project is maintained by [Renfos Technologies](https://renfos.com) and supported by our amazing sponsors:

- Want to sponsor this project? [Become a sponsor](https://github.com/sponsors/litepie)

---

**Built with ❤️ by the [Renfos Technologies](https://renfos.com) Team**

*Lavalite Teams - Where collaboration meets innovation.*

[⭐ Star us on GitHub](https://github.com/litepie/teams) | [🐦 Follow us on Twitter](https://twitter.com/litepie) | [💼 Visit Renfos](https://renfos.com)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance65

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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

Total

5

Last Release

210d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1788735?v=4)[Renfos Technologies](/maintainers/Renfos)[@Renfos](https://github.com/Renfos)

---

Top Contributors

[![georgemjohn](https://avatars.githubusercontent.com/u/7950080?v=4)](https://github.com/georgemjohn "georgemjohn (6 commits)")

---

Tags

laravelworkflowrolespermissionsmulti-tenantcollaborationtenancyTeams

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/litepie-teams/health.svg)

```
[![Health](https://phpackages.com/badges/litepie-teams/health.svg)](https://phpackages.com/packages/litepie-teams)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6712.1k2](/packages/hasinhayder-tyro)[wnikk/laravel-access-rules

Simple system of ACR (access control rules) for Laravel, with roles, groups, unlimited inheritance and possibility of multiplayer use.

103.6k1](/packages/wnikk-laravel-access-rules)[amdadulhaq/guard-laravel

Guard is Role and Permission management system for Laravel

134.4k](/packages/amdadulhaq-guard-laravel)

PHPackages © 2026

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