Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routes not working #47

Closed
intositeme opened this issue Feb 4, 2016 · 10 comments
Closed

Routes not working #47

intositeme opened this issue Feb 4, 2016 · 10 comments

Comments

@intositeme
Copy link

in my own routes.php file i have

Route::group(['middleware' => 'web'], function () {
    Route::auth();
    Route::get('/', 'IndexController@index');
});

But it keeps going to the Pratt Landing Page

@acacha
Copy link
Collaborator

acacha commented Feb 4, 2016

Hello @intositeme,

Could you give us more info please? I can reproduce the problem. Wich version of Laravel are you using?

@schealex
Copy link

schealex commented Feb 4, 2016

same here the routes from vendor override the routes from the app itself

@acacha
Copy link
Collaborator

acacha commented Feb 4, 2016

Ok now I understand! Two thinks to take into account:

  1. In file config/app.php put App\Providers\RouteServiceProvider::class after AdminLTETemplateServiceProvider service provider

  2. Change RouteServiceProvider map method to:

public function map(Router $router)
    {
        $this->app->booted(function () use ($router) {
            $router->group(['namespace' => $this->namespace], function ($router) {
                require app_path('Http/routes.php');
            });
        });
    }

@schealex
Copy link

schealex commented Feb 4, 2016

i just completly removed the AdminLTE Service provider, as i really don't see any need for it :)

but the posted fix works too

@acacha
Copy link
Collaborator

acacha commented Feb 4, 2016

Yes once package publish files you can remove AdminLTE service provider so it's an option ;-)

@spurdow
Copy link

spurdow commented Feb 6, 2016

Same issue, but having a hard time debugging when the answer is here. I knew that it overrided the routing stuff, but its really helpful if you put a 'warning message' in the readme file. thanks

@aliefmaksum
Copy link

Yeah, I also confused with these issues, I think it's worth to notify in the main page.

@acacha
Copy link
Collaborator

acacha commented Feb 9, 2016

Added to README.

@acacha acacha closed this as completed Feb 9, 2016
@acacha acacha mentioned this issue Feb 9, 2016
@GSheltonIII
Copy link

I am facing this issue as well. Changing the order of the classes in app.php and changing the code in RouteServiceProvider did not fix it. And oddly enough if I remove the service provider as @schealex stated, it fails to load the home.

The only way I could fix it was to move all routes from the vendor routes file to the main one. Seems to be working for me so far.

@minedun6
Copy link

not a solution as anyone that tries to use ur project is goiung to be downloading the vendor with prefilled routes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants