0

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.

4

1 回答 1

1

我不确定你真正想要通过重定向来完成什么,但由于问题可能正是它,你可以这样做:

Route::get('/admin', array('before' => 'auth.basic', 'uses' => 'AdminController@createAdmin'));
于 2013-11-13T10:48:32.547 回答