This episode is for members only

Sign up to access "Laravel Teams" right now.

Get started
Already a member? Sign in to continue
Playing
23. Displaying invitations

Episodes

0%
Your progress
  • Total: 4h 36m
  • Played: 0m
  • Remaining: 4h 36m
Join or sign in to track your progress
01. Introduction and demo
4m 49s
0%
02. Setup with Pest
4m 2s
0%
03. Building the user teams relations
6m 5s
0%
04. Creating a personal team when registering
6m 3s
0%
05. Leaving all teams when an account is deleted
3m 55s
0%
06. Tracking the current team
4m 50s
0%
07. Showing team details in the UI
2m 55s
0%
08. Switching to another team
7m 24s
0%
09. Authorising team switching
6m 53s
0%
10. Updating a team name
10m 48s
0%
11. Basic roles and permissions setup
5m 26s
0%
12. Team roles and permissions middleware
9m 18s
0%
13. Authorising current team updates
3m 43s
0%
14. Testing team permissions through HTTP requests
3m 58s
0%
15. Leaving a team
10m 50s
0%
16. Displaying team members
8m 42s
0%
17. Making team members look better
5m 3s
0%
18. Removing a team member
15m 18s
0%
19. Preventing self removal from a team
4m 7s
0%
20. Storing invitations
13m 31s
0%
21. Validating invitations
6m 38s
0%
22. Authorising team invitation creation
6m 22s
0%
23. Displaying invitations
3m 16s
0%
24. Revoking invitations
12m 46s
0%
25. Sending an invitation email
13m 6s
0%
26. Accepting an invitation
12m 22s
0%
27. Displaying a modal to change a member’s role
10m 31s
0%
28. Updating a member’s role
9m 5s
0%
29. More authorisation and checks for role changing
10m 14s
0%
30. Fixing up the email sending test details
49s
0%
31. Fixing and validating email addresses for invites
1m 32s
0%
32. Tidying up @can directive checks
3m 25s
0%
33. Detaching roles when removing users
5m
0%
34. Adding an extra layer of protection to the team middleware
6m 35s
0%
35. Getting related models through teams
5m 37s
0%
36. Building a helper to access the current team
10m 47s
0%
37. Getting all related models through all teams
7m 15s
0%
38. Creating new teams
13m 7s
0%

Transcript

00:00
Okay let's go ahead and list out all of the invitations. Now to display this we could either
00:04
reuse the invite to team permission or we could create a separate view team invites permission. I'm just going to go ahead and reuse this but you can go ahead and change that over depending on how granular you want this to be. Now we're pretty much going to copy the entire for each here we're going to put this within the same unordered list actually we'll keep
00:27
the style the same but we'll keep these next to each other so they kind of sit together. So what do we want to do well we want to go through all of the team invites as an invite and then we want to output a component in here so let's just dump out the invite token just for now and we'll figure this out. So if we come over to our team model we've already
00:48
got invites which we added a little bit earlier for our test so that's already in there and we should see a list of all of our invites now we're in the Mable account at the moment so let's go ahead and log in with my account because I only have permission to see this and we can go ahead and invite someone so let's invite completely different email address and there we go great.
01:13
Let's just go ahead and start this component out really quickly it's going to be pretty similar to the team member one but just with less details so let's go ahead and make out a component here and let's call this team invite item okay great so let's go ahead and just output this in here so team invite item and of course we're going to pass the invite directly down to here so it's
01:39
pretty much going to be exactly the same thing we're going to have a list item here let's have a class with py4 to make this pretty much the same as the team member one and again we'll do exactly the same thing here we'll create out a class in here with flex item center and space x of 2 and then in here we won't include an avatar there's no point we'll just include the invite
02:02
email let's say invite email and we probably could have just copied this entire thing over but let's just replicate the same styles that we had for the other ones we've got a font of semi-bold text gray of 900 and flex of auto so let's open this up have a look and there we go okay so also in here we're going to need a drop down this is going to be to cancel the invite off this will
02:26
sit right next to this so this flex can basically just sit these together so let's go ahead and just pull over from the team member item this entire drop down again just copy and paste so we don't need to do too much work and let's go and adjust this so we'll have the same drop down here and we will get rid of this and just use this to revoke an invite okay let's open this up and
02:58
there we go so we can revoke this invite this is just a pending invite okay so that's pretty much it for now let's just add one more just to make sure that this looks okay and yeah there we go great so we've got a list of our pending invites in there now let's go ahead in the next episode and look at how we revoke these invites
38 episodes4 hrs 36 mins

Overview

Need team functionality in your Laravel application? Let’s build it from scratch.

We’ll cover the basics of creating teams, switching between them, sending secure team invites by email, and managing team members.

Powering everything will be roles and permissions for each member, with the ability to switch roles directly from your team dashboard.

Once you’re done, you’ll have mastered team functionality in Laravel.

Alex Garrett-Smith
Alex Garrett-Smith
Hey, I'm the founder of Codecourse!

Episode discussion

No comments, yet. Be the first!