无法在laravel 4中从ajax调用接收的数据库中存储数据

时间:2014-04-07 06:32:20

标签: php mysql ajax laravel-4

Route::get('/comment/{data}', function($data){


        if (Request::ajax()) {

        //echo $data; *i checked here echo prints the content of $data but i cant store it in database. i dont know why its not store by using below code plz help me to find error.

        $comm = new Data;
        $comm->details = Input::get('data');
        $comm->save();

    }
});

1 个答案:

答案 0 :(得分:0)

Route::post('/comment/{data}', function($data){
}