Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Teams support in Laravel Jetstream after initial install

If I already have an existing Laravel Jetstream (Inertia) project which was installed without the --teams option is there a way to go back and install support for teams given that I have already created multiple controllers, models, migrations and other customizations within the app?

like image 269
Joseph Avatar asked Jan 06 '21 17:01

Joseph


People also ask

How do I activate teams in laravel Jetstream?

Thankfully, Jetstream allows you to enable team member invitations for your application with just a few lines of code. To get started, pass the invitations option when enabling the "teams" feature for your application. This may be done by modifying the features array of your application's config/jetstream.

Why do we use Jetstream in laravel?

Jetstream provides the implementation for your application's login, registration, email verification, two-factor authentication, session management, API via Laravel Sanctum , and optional team management features. Jetstream is designed using Tailwind CSS and offers your choice of Livewire or Inertia scaffolding.

Is laravel Jetstream free?

Laravel Jetstream is free and opensource.

Should laravel use Jetstream?

You should use Jetstream if: You're conversant with Laravel Livewire, Inertia, and tailwind or you don't mind taking time to learn them. You have an understanding. You want to immediately start building the core functionality of your app without investing much time in procedures.


1 Answers

AS A TEST, I did it here on my Jetstream LIVEWIRE project, by reinstalling Jetstream with --teams. It's doable, but beware of some side effects.

What I did:

  1. Publish Jetstream view files, if you haven't already:

    php artisan vendor:publish --tag=jetstream-views
    
  2. Update Jetstream to version 2.0 (upgrade guide)

  3. Reinstall Jetstream with options --teams:

    php artisan jetstream:install livewire --teams
    

    Warning: This will install the remaining actions, models, factories, and tests and will update several files, among those some view files, including on the layout views folder, so be careful and have them in source control or in a backup BEFORE trying this. Some view files will change entirely, so you will have to manually merge the changes with your old ones.

  4. Run the migrations that were created

like image 88
sjardim Avatar answered Jan 03 '23 18:01

sjardim