0

In the old Laravel Spark (now Spark Classic) you could utilise a configuration method Spark::prefixTeamsAs('bands'); a new project I'm working on uses the new Laravel Spark which is now more of a billing conduit and allows team management to be taken care of by Laravel Jetstream. Does Laravel Jetstream support referring to teams by other labels?

SecretAgentMan
  • 2,856
  • 7
  • 21
  • 41
Grant
  • 5,709
  • 2
  • 38
  • 50

2 Answers2

1

I looked to see if there was a built in feature and found a lot of people like you looking for a solution with answers with terrible solutions. Here is what I did that works better than all the solutions provided. The only downside/upside is the functions of JetStream will obviously still call it Teams. I removed my default built App\Models\Team and replaced it with in my case Projects and overrided the default table naming convention, for you can be Bands:

<?php
 
namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Laravel\Jetstream\Events\TeamCreated;
use Laravel\Jetstream\Events\TeamDeleted;
use Laravel\Jetstream\Events\TeamUpdated;
use Laravel\Jetstream\Team as JetstreamTeam;

class Bands extends JetstreamTeam
{
    use HasFactory;

    public $table="bands";
}
Neo
  • 11,078
  • 2
  • 68
  • 79
0

Jetstream doesn't have built-in support for renaming Teams. I worked around this by publishing the views and renaming Team in the applicable view files. I haven't overrode the routing yet, so my Teams related paths still have team in the URL.

Kevin Marsden
  • 677
  • 1
  • 10
  • 17