试图防止用户过快发表评论,所以使用 15 秒的间隔是计划。
但是,此查询无法查看是否在最后 15 秒内发表了评论。我究竟做错了什么?
桌子:
 id  |      comment    |     created_at      |
==============================================
 2   |   blah casd     | 2013-06-20 18:14:17 |
但是,我无法让它与 Eloquent 一起使用
    //are they commenting too fast?
    $protection = DB::table('comments')
       ->where('user_id', '=', $userid)
       ->where('created_at', '<', '(NOW(), INTERVAL 15 SECOND)')
       ->get();
    if(!empty($protection)) {
         return Redirect::back()->with_message('Please wait 15 seconds between comments.', 'error'); 
    }