多个mysql行条目没有明显的原因(偶尔会发生一次)

I have the following code for store() in my controller. Although the awkward delete was added later to get rid of the problem, it did not work.

public function store()
{
    $input = \Input::all();
    $userdetail = \Auth::User();

    foreach($input['user_id'] as $user_id) {
        \StudentAttendance::where('academicsession_id', '=', $input['academicsession_id'])
            ->where('class_id', '=', $input['class_id'])
            ->where('section_id', '=', $input['section_id'])
            ->where('attendance_on', '=', $input['attendance_on'])
            ->where('user_id', '=', $user_id)
            ->delete();
        $obj = new \StudentAttendance();
        $obj->academicsession_id = $input['academicsession_id'];
        $obj->class_id = $input['class_id'];
        $obj->section_id = $input['section_id'];
        $obj->user_id = $user_id;
        $obj->attendance_on = $input['attendance_on'];

        $obj->is_present = (isset($input['is_present'][$user_id])) ? 1 : 0;
        $obj->addBy = $userdetail['id'];
        $obj->status_id = 1;
        $obj->save();
    }

    return \Redirect::to('teachers/attendance')->with('status_success', trans('msg.success_attendance_saved'));
}

The problem is, every once in a while, for no apparent reason, I get duplicate entries in my db with same created_at and updated_at timestamps.

Please follow the link to see the screenshot (http://i.imgur.com/WGciSVW.jpg?1)

Not really sure what might be causing it to happen. Any help is appreciated. Thanks

Disable/Hide the submit button once it is clicked may be due to frequent clicks it cause this error.