I've just started building a Laravel application and came across a problem with routing.
- Laravel version - 4.2
- PHP version - 5.5
- I'm using XAMPP
- I have the rewrite module active on Apache
Here is my Routes file:
<?php
Route::get('/', array(
'as' => 'index',
'uses' => 'IndexController@index'
));
Route::get('/account', array(
'as' => 'account',
'uses' => 'AccountController@get_create'
));
My controllers look like this:
<?php
class IndexController extends BaseController
{
public function index()
{
return View::make('index');
}
}
<?php
class AccountController extends BaseController
{
public function get_create()
{
return 'asd';
}
public function post_create()
{
}
}
Here is my error:
Symfony\Component\HttpKernel\Exception\NotFoundHttpException thrown with message ""
Stacktrace:
#11 Symfony\Component\HttpKernel\Exception\NotFoundHttpException in C:\xampp\htdocs\Protosite\bootstrap\compiled.php:5680
#10 Illuminate\Routing\RouteCollection:match in C:\xampp\htdocs\Protosite\bootstrap\compiled.php:5004
#9 Illuminate\Routing\Router:findRoute in C:\xampp\htdocs\Protosite\bootstrap\compiled.php:4992
#8 Illuminate\Routing\Router:dispatchToRoute in C:\xampp\htdocs\Protosite\bootstrap\compiled.php:4984
#7 Illuminate\Routing\Router:dispatch in C:\xampp\htdocs\Protosite\bootstrap\compiled.php:715
#6 Illuminate\Foundation\Application:dispatch in C:\xampp\htdocs\Protosite\bootstrap\compiled.php:696
#5 Illuminate\Foundation\Application:handle in C:\xampp\htdocs\Protosite\bootstrap\compiled.php:7744
#4 Illuminate\Session\Middleware:handle in C:\xampp\htdocs\Protosite\bootstrap\compiled.php:8351
#3 Illuminate\Cookie\Queue:handle in C:\xampp\htdocs\Protosite\bootstrap\compiled.php:8298
#2 Illuminate\Cookie\Guard:handle in C:\xampp\htdocs\Protosite\bootstrap\compiled.php:10961
#1 Stack\StackedHttpKernel:handle in C:\xampp\htdocs\Protosite\bootstrap\compiled.php:657
#0 Illuminate\Foundation\Application:run in C:\xampp\htdocs\Protosite\public\index.php:49
EDIT: One thing I forgot to mention, the index works fine, it's the account page with the error.
I've looked at similar problems but for some reason they have not solved it.
Cheers!