A full-featured multi-tenant app with Laravel Part 3 — Invitation.

Ashok Gelal
4 min readJan 13, 2018
Photo by rawpixel.com

Part 0, Part 1, Part 2, Part3 👇, Part4, Part 5, Part 6, Part 7

In this part of writing a complete Laravel multi-tenant app series, we’ll accomplish the following tasks:

✅ Create a token and notify the admin via an email

✅ Create a page for setting a password

Right now when we create an admin for a new tenant, we auto assign a random password for the account and print it out so that the admin can login using this password. This is okay, maybe, for an MVP but it is a little weird for a real app and because we are really building a real app, this isn’t okay.

So, instead of printing out the password, we’ll email the admin an invitation to let her know that a tenant is created and she can set a new password for her account.

Sending an email with Laravel is as easy as it gets but how do we actually do the actual management of invitations? We have few things to worry about — setting up the proper tables, creating secure tokens, verifying the token and making sure it is actually linked to the proper admin, adding UI etc. That’s a lot of code for and looks intimidating!

But Laravel already comes with (almost) all the code for handling this albeit under a different name — Password Resets

--

--

Ashok Gelal

Learner. Achiever. Loves writing clean code and craft beautiful products. 👉 https://alpas.dev