0

I am trying to access a route in laravel. It's working fine for the below scenario

Route::get('/signup', function() { return View::make('signup'); }); 

But it's not working when I am trying to access via controller.

Route::get('/signup', 'signupController@signup'); 

Below is the content of my signupController file.

<?php namespace App\Http\Controllers; use View; use App\Http\Controllers\Controller; class signupController extends Controller { public function signup() { $view = View::make('signup'); return $view; } } 

I am getting the below error NotFoundHttpException in RouteCollection.php line 143:

Find my route.php file content

<?php /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond to | and give it the controller to call when that URI is requested. | */ Route::get('/', function () { return view('welcome'); }); Route::get('/signup', 'signupController@signup'); 
1
  • The code should work as it is, the error has to be somewhere else Commented Aug 3, 2015 at 10:06

1 Answer 1

1

Shouldn't it be?

Route::get('/signup', ['uses' => 'signupController@signup']); 

I don't see any other reason.

Sign up to request clarification or add additional context in comments.

1 Comment

and the error message is the same? maybe you have errors in other part of your routes.php - could you edit your question and provide the routes.php content?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.