0
votes

I need some help. I'm new to laravel and I'm experiencing some weird things.

I have a "users" resource inside views/users. Inside it are index.blade.php andcreate.blade.php.

My app url is http://laravel.dev/ so basically if I need to access the "Create Users" form I will go to http://laravel.dev/users/create the view loads fine but when I tried to click a link on my navbar it automatically adds "users" on the url even if there's no "users" in the nav url link. Example.

Dashboard

When I click it, it will add "users" in the beginning of the url automatically making it users/dashboard and as expected I get a 404.

My navbar is being loaded from other php file in my header.php

Here's my route

/*Route for Users*/
Route::resource('users', 'UsersController');
1
Are you using URL::to or URL::route to create the links? If yes and still have this problem, give a try to base href in your html.user2094178

1 Answers

0
votes

I would suspect that you are using page relative links, correct? In a nav I've always found it best to use root specific links so "/dashboard" vs. "dashboard."

If you are new to Larvel you may want to take a serious look at the rooting options before going to far into your project just because if you decided to go a different way, namely routing through the controllers (http://laravel.com/docs/controllers#resource-controllers) With a large app it can be a far better way to go, but the refactoring can be tough after to you have a complex enough app to justify it.