Question

I've spent two days trying to resolve this.

I have an app powered with Laravel 4, and there is a problem. I'm using auth.basic in one Route, here is some code:

Route::get('/admin', array('before' => 'auth.basic', function()
{
    return Redirect::action('AdminController@createAdmin');
}));

I'm definitely getting inside of the anonymous function, but there is exception: *Unknown action [AdminController@createAdmin]. *

Again, if I define route like so:

Route::get('/admin', 'AdminController@createAdmin');

Everything works fine. I think, maybe the issue is in the some scope thing... Thank you in advance.

Was it helpful?

Solution

I'm not sure what you are really trying to acomplish with a redirect, but since the problem might be exacly it, you could just do:

Route::get('/admin', array('before' => 'auth.basic', 'uses' => 'AdminController@createAdmin'));
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top