PHPackages                             danpalmieri/jetstream-team-url - 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. danpalmieri/jetstream-team-url

ActiveLibrary

danpalmieri/jetstream-team-url
==============================

A package to show the current team as a prefix in the url. You must install Laravel Jetstream with the Team feature enabled.

v1.3(2y ago)220MITPHPPHP ^8.2

Since Apr 17Pushed 2y ago1 watchersCompare

[ Source](https://github.com/danpalmieri/jetstream-team-url)[ Packagist](https://packagist.org/packages/danpalmieri/jetstream-team-url)[ Docs](https://github.com/danpalmieri/jetstream-team-url)[ GitHub Sponsors](https://github.com/DanPalmieri)[ RSS](/packages/danpalmieri-jetstream-team-url/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (12)Versions (12)Used By (0)

Laravel Jetstream Team URL
==========================

[](#laravel-jetstream-team-url)

[![Latest Version on Packagist](https://camo.githubusercontent.com/eec417f09bf2831cd6bc3c48d7c3891a52f421da63df79175796742d16f23da7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64616e70616c6d696572692f6a657473747265616d2d7465616d2d75726c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/danpalmieri/jetstream-team-url)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/10b3232ddc99b1294dbb4c76da0c5af775ef32ef89c5c47b535437b6e19a90d3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f64616e70616c6d696572692f6a657473747265616d2d7465616d2d75726c2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/danpalmieri/jetstream-team-url/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)

A package to show the user's current team in the url. Good to generate permalinks and to auto switch when is convenient. You must install Laravel Jetstream with the Team feature enabled.

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

[](#installation)

You can install the package via composer:

```
composer require danpalmieri/jetstream-team-url
```

You can publish the config file with:

```
php artisan vendor:publish --tag="jetstream-team-url-config"
```

This is the contents of the published config file:

```
return [
    'url' => [
        'prefix' => 'teams', // the prefix for the team routes
        'team_attribute' => 'id', // the attribute to use for the team route
    ],

    'middleware' => \DanPalmieri\JetstreamTeamUrl\Middleware\VerifyOrSetCurrentTeamInRoute::class,

    'livewire_support' => true, // Add a persistent middleware to Livewire to support the team in the URL

    'on_denied' => [
        'strategy' => 'redirect', // abort|redirect
        'redirect' => [
            'to' => '/',
            'with' => [
                'key' => 'error',
                'value' => 'You are not allowed to access this team.',
            ],
        ],
        'abort' => [403, 'You are not allowed to access this team.'],
    ],

    'on_different_team' => [
        'strategy' => 'switch', // abort|switch
        'abort' => [403, 'You are not working on the right team.'],
    ],
];
```

Usage
-----

[](#usage)

Just add the method useTeamInUrl() method to your routes group.

```
Route::useTeamInUrl(function () {
    Route::get('/dashboard', fn () => view('dashboard')); // example.test/teams/2352/dashboard
});
```

You also get the currentTeamRedirect() method. Put this outside of the Route::useTeamInUrl() method.

```
Route::currentTeamRedirect('_'); // example.test/_/posts/34 -> example.test/teams/2352/posts/34
```

Behaviour
---------

[](#behaviour)

Somethings to note about the package:

- The package will automatically add the team id (or other attribute) to the url if the user is logged and on a team (and you are using named routes).
- It will also check if the user is on the correct team. If not, it will redirect or abort.
- The currentTeamRedirect($char) method will replace the occurence of the character with the current team id (or other attribute) in the url.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Dan Palmieri](https://github.com/danpalmieri)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

27

↓

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

11

Last Release

737d ago

Major Versions

v0.4.3 → v1.02024-04-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/381750d6f9c822e20211f04f80671cc11ef4551cd203c4ebc4320c8a48c3bca6?d=identicon)[danpalmieri](/maintainers/danpalmieri)

---

Top Contributors

[![danpalmieri](https://avatars.githubusercontent.com/u/1392562?v=4)](https://github.com/danpalmieri "danpalmieri (46 commits)")

---

Tags

laraveldanpalmierijetstream-team-url

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/danpalmieri-jetstream-team-url/health.svg)

```
[![Health](https://phpackages.com/badges/danpalmieri-jetstream-team-url/health.svg)](https://phpackages.com/packages/danpalmieri-jetstream-team-url)
```

###  Alternatives

[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[spatie/laravel-prometheus

Export Laravel metrics to Prometheus

2651.3M6](/packages/spatie-laravel-prometheus)[hydrat/filament-table-layout-toggle

Filament plugin adding a toggle button to tables, allowing user to switch between Grid and Table layouts.

6292.3k1](/packages/hydrat-filament-table-layout-toggle)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

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