My new route is causing an error and I need help finding it

So the error I am getting is Symfony Component HttpKernel Exception NotFoundHttpException.

Here is the route:

Route::get('/', '<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9adbefeef2d9f5f4eee8f5f6f6ffe8daf3f4feffe2">[email protected]</a>');
Route::get('/login', '<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="571622233f1438392325383b3b3225173b38303e39">[email protected]</a>');
Route::post('/login', ['before' => 'csrf', 'uses' => '<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fcbd898894bf9392888e939090998ebc9d">[email protected]</a>uthenticate']);
Route::get('/logout', '<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="49083c3d210a26273d3b2625252c3b0925262e263c3d">[email protected]</a>');

Route::group(['before' => 'auth'], function() {

$noIndex = [ 'except' => ['index'] ];
$noShow = [ 'except' => ['show'] ];

Route::get('/dashboard', '<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0c5c6d6b697f4f6362787e636060697e4c686d7f646e636d7e68">[email protected]</a>');

Route::get('/test', '<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="c28fa7b1b1a3a5a781adacb6b0adaeaea7b082abaca6a7ba">[email protected]</a>');

Here is the controller:
/**
 * Display a listing of the resource.
 * GET /test
 *
 * @return Response
 */
public function index()
{
    return View::make('test.index');
}

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Now that we have some more complete information regarding your routes.php setup, it’s possible that the problem is due to the auth filter.

(I’m assuming you left off the final }); from your routes.php above.)

Try removing the before filter (or change it temporarily to ['before' => 'none']) and reload desk.dev:8000/test. Make sure you don’t simply hit reload on the current error page, since it may be pointing to desk.dev:8000/login.

If your AuthController is not set up, or is missing the login method, you will get a NotFoundHttpException when the auth filter in filter.php tries to redirect to your login page, with:

return Redirect::guest('login');


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x