Menu Builder with Dynamic Routes

jim-adamek

Mar 18th, 2017 03:06 AM

Hi Again,

As I set up Laravel Voyager, in most cases I want my users to see only their posts, images, or users within their group or company. I know that I will need to use the Menu Builder with Link Type selected as Dynamic Route to accomplish this.

Can anyone explain or give some examples of how we enter the Route and Route Parameters so they work together? For instance if I want a user to see only their posts would Menu Builder look like this:

Route:   /admin/posts/{id} 
	Parameter for the logged in user:  $user->id
	

Is that how the route and parameter would be formatted?

Or if I wanted a user to see only users in their company would that look like this in Menu Builder:

Route:  /admin/user/{company_id}
  Parameter for user like: $user->company_id

Thanks for your help on this in advance!

tnylea

Mar 18th, 2017 04:47 PM

Hey Jim,

That's actually a good question and that feature needs to be documented. I believe that Mark may have been working on that one, so we'll have to see if he can chime in here and let us know how the dynamic menu routes work. I'm certain I will be looking into this myself as I want to continue creating more videos about how to use all these awesome new features.

I'll see if Mark can shed some more light on this; otherwise I will be taking a look at it more this weekend and keep you posted with what I find out.

Thanks again for using the forums. I really want this to be a good place where people can come ask a question and get some assistance.

Talk to you soon.