#Reusing views and routes

3 messages · Page 1 of 1 (latest)

serene sandal
#

Hi, i'm struggling trying to figure out how to use re-use my views and how the routes would look for this.
This is the best way i've come up with.

Scenario: A user has orders and can view an individual order.

admin:
random.com/users // index of users

users:
random.com/users/1 // can view his own profile and admin can view this user
random.com/users/1/orders // can view his own orders and admin can view them
random.com/users/1/orders/54 // can view his own individual order and admin can view them

Additional question: Can I make a route random.com/orders that would go to random.com/users/1/orders?

modest gyro
#

If you want to re-use views between an admin panel and a front-end website, then extract the mark-up to partials, and @include them where you need them.

#

@include('partials.order-details') or something.