Laravel 13 Teams Tutorial: Complete CRUD
Chapters9
Overview of using inertia with react and the goal to implement Laravel teams and themes in the app.
Tony Xhepa shows how to implement CRUD with Laravel 13 Teams and Inertia React, including team-based post ownership and per-team visibility.
Summary
Tony Xhepa demonstrates a practical walkthrough of using Laravel 13's Teams feature alongside Inertia and React to build a multi-team CRUD app. He starts by creating a user, which automatically generates a personal team, then creates posts scoped to either the personal team or a specific team. The tutorial covers team creation, inviting members, and switching between teams to see how posts and contributors change with the active team. He highlights the permission logic: owners can edit and delete their posts, while team members can view but not modify others’ posts. The example includes a post migration that links posts to both team_id and user_id, and he shows how the UI (Inertia routes) reveals edit/delete options only when the current user owns the post. Finally, Tony emphasizes practical tips like inviting teammates and testing across multiple accounts to verify per-team visibility. The whole session is a hands-on guide for building collaborative content with Laravel’s team scoping in a real-world CRUD workflow.
Key Takeaways
- New users automatically receive a personal team in Laravel when the account is created, enabling immediate per-user data scoping.
- Inviting a teammate creates a separate user that can access posts within the target team, with visibility governed by team membership.
- Posts are associated with both team_id and user_id in the migration, which enables per-team ownership logic in the UI.
- Owners can edit and delete their own posts, while non-owners in a team can only view, mirroring typical access control.
- Switching between teams (personal vs. inertia) changes which posts are visible and editable, demonstrating dynamic access control in the Inertia front end.
- The UI shows edit/delete links conditionally by comparing the logged-in user ID to the post's user_id, ensuring proper permissions.
- Inviting members and testing from another account is demonstrated as a practical approach to verify team-based permissions and visibility.
Who Is This For?
Front- and back-end developers who want to implement Laravel 13 Teams with Inertia and React for multi-tenant style collaboration; useful for building per-team CRUD apps with clear ownership rules.
Notable Quotes
"Hello friends, Tony here. Welcome."
—Intro greeting establishing the presenter and style.
"By default when we create a user and we work with teams it is going to also generate a team which is a personal team for this specific user."
—Key point about automatic personal team creation.
"We can open that post here. We can go back and we can delete also if we want."
—Demonstrates per-post ownership actions and permissions.
"The owner of the team can also delete and edit the post."
—Summarizes owner permissions within a team.
"We can only see the posts. As you can see, we cannot edit and delete because we are not the owner of that post."
—Shows non-owner access restrictions inside a team.
Questions This Video Answers
- How do Laravel 13 Teams auto-create a personal team for new users?
- How can I implement per-team post ownership with Laravel migrations (team_id and user_id)?
- How do I switch between teams in a Laravel + Inertia + React app and see different data sets?
- What are the permission rules for owners vs. members in Laravel Teams (edit/delete vs view)?
- Can I invite teammates and verify their access across multiple accounts in a Laravel Teams app?
Full Transcript
Hello friends, Tony here. Welcome. In today's video, I'm going to work again with teams. In this video, so I have used inertia with react. And in this video, I want to show you how we can make a crow with using themes also. So let's go and register here with a new user using the fake filler. And by default when we create a user and we work with teams is going to also generate a team which is a personal team for this specific user and I have added here a card for post. If I go here yeah we have something like this.
No posts yet. We can go and create a new post. Let's use fake filler. Publish a post. Okay. We have also to delete the post and we can go back to post. And right now as you can see we have only one post, one contributors and yeah three three words. The user who created this post is this one which is the the same user as we are logged in right now. And we can open that post here. We can go back and we can delete also if we want. Now let's go and create a new team.
We can create a new team here or we can go on the settings teams and I'm going to create a new team and let's name it just inertia here. Okay, I'm going to create this team. We are the owner of this team. Now I'm going to invite a member for this one. So let's just invite. I'm going to use a fake filler here and send the invitation. Okay, here we are. We are on this inertia now. Okay. If I go to post inertia theme, if I go to post here, you can see we don't have any post.
But if we change the this one which is our personal team, we have a new post. And here we have a post because when we created the post, I chose this personality. Now if I choose another team, we go to create a new post here. Publish the post. Go to back the post. And now we have a post created for this inertia in this inertia team and also by this user which we are logged in right now. If I go and create another one publish the post go back now we have two posts one contributors and three words here and yeah here is a post one and here's the post two.
Now, because we are the owner or we are we are who created the post, we can edit and delete the post here. Now, let's go back and just go to teams again because I want to copy this email here. I'm going to open this project in another browser in here. I'm going to register and I'm going to use a fake filler here. Just copy the email we have here and I'm using metrap again. Okay. Yeah, we have sent the invitation which is right now here. Let me just paste this email and I'm going to create the account.
Okay. Right now when we create the account immediately the Laravel is going to create also a personal team for this user. But now let's go and copy the invitation link and I'm going to paste that link here and hit enter. And now we redirect the dashboard but inside the inertia team. Okay. If I go to posts you can see we have two posts here because we are inside the inertia team. We have two posts and one contributors. Yeah, we can only see the posts. As you can see, we cannot uh edit and delete the post because we are not the owner of that post.
If I go to and select my personal team, I don't have any post yet. Here, if I go, we can create new post and go back. And yeah, here on my personal team, we have one post. But what if I choose the inertia here and create a new post? Let's use a fake filler. Save. Back to post. And now we have three posts here inside the inertia team. Two contributors, two users. This one and also this user here. And now we have two post latest entries. We can only see them. But this because we created this post we can open, delete.
So let's open update and so on. Okay, this is how we can work with crat on using the Laravel teams feature. We can create a crow for the specific team and only the owner. We also can change that. For example, the owner of the team can also delete and edit the post. But for now, only the owner of the post can edit and delete. The members of the team can just view a post grat. And I'm going to show you also the post uh migration. Here I have the post migration. In the post migration, I have added the team ID and the user ID.
Okay. And here we check if the user ID is the same as the out ID. We display the link to open and delete the post. The same for here. If we go the inertia post if we over it you can see we have a link to edit and delete. So we check if the out ID is equal with the post user ID. We display the links here. Okay friends, that's it all about this video. What I wanted to show you uh crat with Laravel team themes feature. Now if you like such a videos, don't forget to subscribe to my channel, like the video, share with your friends because it's going to rank me on YouTube and it's going to motivate me to create more content like this.
If you have any questions, drop a comment on this YouTube channel and I'm going to answer or create another video about your comment. That's it for now. All the best and see you in the next one.
More from Tony Xhepa
Get daily recaps from
Tony Xhepa
AI-powered summaries delivered to your inbox. Save hours every week while staying fully informed.









