如果不能正常显示,请查看原文 , 或返回

php

I'm having a minor issue with Laravel 4. I'd like to use the delete() method on a record but for some reason it doesn't actually delete the record. destroy() does, though, so my code is good. Also, if I pass Teetime::where('date', '=', $formattedDate)->count() to my view I get one which is correct. What's the problem?

        if($action=="delete") {
            $teetime = Teetime::where('date', '=', $formattedDate)->firstOrFail();
            // for some reason $teetime->delete() doesn't work
            Teetime::destroy($teetime->id);
        }
返回