0
votes

I installed Laravel in a subdirectory, so like: Root - mylaravel

When i use the command to generate URLs: {{ URL::route('controller.show', $controller->slug) }}

Its generates an URL like: http:// localhost / controller / show / asdf But it should be: http:// localhost / mylaravel / controller / show / asdf

In app.php I tried with:

  • 'url' => 'http:// localip / phptodomanager'
  • 'url' => 'http:// localhost / phptodomanager'
2
post your route file.itachi
Use a virtual host, check this answer.The Alpha

2 Answers

0
votes

Use grouping with prefix in routes.php:

Route::group(array('prefix' => 'mylaravel'), function() {
    // your routes go here
});

as in docs http://laravel.com/docs/routing#route-prefixing

0
votes

you are using a resource controller.

look at the naming convention here.

you don't have any route named controller.show

a route can be projects.show under ProjectController.

you will access it by http://localhost/mylaravel/projects/show/{project}

which in controller will be,

public function show($project)
{

}

you are mixing up all the routes and i am sure, you are also writing your own routes. don't mix resource controller and custom routes. stick to one or the other method unless avoidable.