Speeding Up Laravel Tests with tmpfs (MySQL in RAM)
If your Laravel test suite is painfully slow and does a lot of database work (multi-tenancy, migrations, seeding), the bottleneck is almost…
When using Laravel Jetstream with teams, you might want to prevent users from creating new teams while still allowing them to be members of multiple teams through invitations. Here's how to implement this pattern.
Modify the create method in app/Policies/TeamPolicy.php:
public function create(User $user): bool
{
// Only allow team creation if the user has no teams
// This effectively limits users to their initial personal team
return $user->allTeams()->count() === 0;
}
This change will:
When a user registers, Jetstream automatically creates their personal team. With our TeamPolicy modification:
v-if="$page.props.jetstream.canCreateTeams" checks/teams/create will return a 403 Forbidden responseGive Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.
Take a look at vroni.com