2

How do you remove the index from a named route?

Routes

<?php

Route::group(array('prefix' => 'reports/finance'), function () {
    Route::controller('/', 'Reports\Finance\HomeController', ['getIndex' => 'reports.finance']);
});

View

{{ HTML::linkRoute('reports.finance', 'admin', ['captial-admin']) }}

Generated URL

/reports/finance/index/captial-admin

What I want...

/reports/finance/captial-admin
Karl Hill
  • 12,937
  • 5
  • 58
  • 95
mybigman
  • 179
  • 2
  • 12

2 Answers2

0

Can you check the 'url' of your app/config/app.php if there is 'index' there?

Melvin
  • 5,798
  • 8
  • 46
  • 55
  • theres no index there... im not sure it can be done without modifying the core? its rather anoying :( – mybigman Jun 06 '13 at 12:53
0

You could be more explicit in your routes definitions.

Route::group(['prefix' => 'foo'], function(){
    Route::get('bar/baz', ['uses' => 'SomeController@getIndex', 'as' => 'route.name']);
});

Beats editing the core.

Neo
  • 876
  • 1
  • 9
  • 25