我已经用了一段时间的Laravel 框架了,期间遇到了不少问题,有一些调试起来着实不太容易,本文筛选出几个,如果能让 大家在 php开发中少走一些弯路,那我就算没白写。
报错:「Can’t swap PDO instance while within transaction」
transactions >= 1) { throw new RuntimeException(" Can't swap PDO instance while within transaction. "); } $this->pdo = $pdo; return $this; } ?>
报错:「Cannot delete job
报错:「No query results for model」
bar = Bar::find($id); } public function handle() { // $this->bar } } ?>
bar = Bar::onWriteConnection()->find($id); } public function handle() { // $this->bar } } ?>
class)->findOrFail($value->id) : $value; } ?>
id = $id; } public function handle() { $bar = Bar::onWriteConnection()->find($this->id); } } ?>