質問

ララベには新しいことです。ルートとコントローラで遊ぼうとすると、この問題がありました。 私はこのコントローラーを持っています

class DashboardController extends BaseController {
public function actionIndex()
    {
        $photos = Auth::user()->photos()->orderBy('created_at', 'desc')->orderBy('id', 'desc')->get();
        return View::make('dashboard.index', array('photos' => $photos));
    }
public function action_insert_test_data()
{   
    $logged_in_user = Auth::user();

    for( $x = 0; $x < 10; $x++ ) {
        $email = rand().'@gmail.com';
        $user = new User();
        $user->email = $email;
        $user->password = Hash::make($email);
        $user->save();

        $logged_in_user->followers()->attach($user->id);
        if( $x >= 5 ) {
            $logged_in_user->following()->attach($user->id);
        }
    }
}
.

と私はこのコントローラのすべてのアクションをダッシュボードページにルーティングしようとします。

Route::controller('dashboard', 'DashboardController');
.

しかし私はうまくいきませんでした、代わりにこのようなエラーメッセージが表示されます

Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException
.

私は何をすべきか?どこで私は間違えましたか?Laravel 4.1を使っています あなたの注意をありがとう

役に立ちましたか?

解決

クラスのメソッドは、getIndexgetInsertTestDataという名前です。

Laravel暗黙のコントローラ

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top