New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

itbm/laravel-jetstream-disable-personal-team

Disable personal teams in Laravel Jetstream
5,855 1
Install
composer require itbm/laravel-jetstream-disable-personal-team
Latest Version:1.1.2
PHP:>=8.1
Laravel:10 · 11
License:MIT
Last Updated:Aug 27, 2024
Links: GitHub  ·  Packagist
Maintainer: itbm

Jetstream Disable Personal Team

This package allows you to disable the personal teams in Laravel Jetstream.

Requirements

This package requires Laravel 10.x and Jetstream 2.x.

Installation

You can install the package via composer:

composer require itbm/laravel-jetstream-disable-personal-team

Usage

All

Update your CreateNewUser.php file to comment out the personal team creation logic:

return DB::transaction(function () use ($input) {
    return tap(User::create([
        'name' => $input['name'],
        'email' => $input['email'],
        'password' => Hash::make($input['password']),
    ]), function (User $user) {
        // $this->createTeam($user);
    });
});

Then, edit web.php and api.php to include the require-team middleware included with this package. This will redirect the user to the team creation page if they have not joined a team yet:

Route::middleware([
    'auth:sanctum',
    config('jetstream.auth_session'),
    'verified',
    'require-team',
])->group(function () {
    // ...
});

Inertia Only

You will need to update your AppLayout.vue file. Find and replace these 2 lines:

<Dropdown v-if="$page.props.jetstream.hasTeamFeatures" align="right" width="60">

<template v-if="$page.props.jetstream.hasTeamFeatures">

with:

<Dropdown v-if="$page.props.jetstream.hasTeamFeatures && $page.props.auth.user.current_team" align="right" width="60">

<template v-if="$page.props.jetstream.hasTeamFeatures && $page.props.auth.user.current_team">

Livewire Only

You will need to update your navigation-menu.blade.php file. Find and replace both instances of this line:

@if (Laravel\Jetstream\Jetstream::hasTeamFeatures())

with:

@if (Laravel\Jetstream\Jetstream::hasTeamFeatures() && Auth::user()->currentTeam)

Related Packages

nascent-africa/jetstrap

A Laravel 8 package to easily switch TailwindCSS resources generated by Laravel...

216,490 706
pixinvent/jetstrap-vuexy

A Laravel 8 package to easily switch TailwindCSS resources generated by Laravel...

26,907 6
madeitbelgium/jetstrap

A Laravel package to switch Jetstream and Breeze Tailwind resources to Bootstrap...

2,510 1
m1ge0/bootsjet

A Laravel 13-ready package for Jetstream + Livewire to switch from Tailwindcss t...

589 10
ezitisitis/jetstream-no-personal-team

Remove personal team forcing from Laravel Jetstream

3,276 0

Version History

Version Released PHP Laravel License
1.1.2 >=8.1 >=10.0 MIT
1.1.1 ^8.1 ^10.0 MIT
1.1.0 ^8.1 ^10.0 MIT
1.0.0 ^8.1 ^10.0 MIT