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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners