Category: Laravel, Laravel, Laravel

I’ve started building a new portal for work, after many iterations we have settled on Laravel 8 and Jetstream. We don’t want these unused entries clogging up the database, as we will consider a team as a company that we transact with.

Great, we create a user and now get no team, but also an error on login: Let’s overwrite some of the Traits in HasTeams to make these optional! Create app/Traits/HasNoPersonalTeam.php with the following contents: We now need to update the User model app/Models/User.php and overwrite two methods on the Jetstream HasTeams trait. We’ll now create a new Middleware to verify that the user has a team and redirect to the jetstream create team page if not.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners