From the course: Advanced Laravel
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
Attaching and detaching relationships - Laravel Tutorial
From the course: Advanced Laravel
Attaching and detaching relationships
- [Instructor] Let's implement the booking feature completely. First, we'll add the links in the navigation. Go to navigation.blade.php. And we need two links. One to book a class, and another one to show booked classes or upcoming classes. So here copy one of these links. Add it here. Change the route to booking.create. And add the same route here as well. Sorry, let's remove the codes. Yeah. And here, let's call it Book a Class. Copy this, paste it again, and say, "Upcoming Classes." Booking.index here as well. And these two routes should only be visible to a member. That is the person who can book classes. Let's say can, book-class. We haven't created this gate yet, so let's do that now in our service provider. Similar to this schedule class. Add another gate definition, book-class. And this time only the user with the role member can book a class. This should work. Let's take a look. Refresh, and yes,…