与Laravel有点问题。我有两个模型(Customer + View),有三个表(customer,customer_vehicle,vehicle),customer_vehicle是一个数据透视表。
我之前添加的数据很好,它存储在数据库中。但是现在,当我尝试运行save()时,它返回true,但是不存储在数据库中。并且只能作为变量访问。
Tinker中的当前代码:
>>> $vehicle->registration="P3N 3LO";
=> "P3N 3LO"
>>> $vehicle->make="Volkswagen";
=> "Volkswagen"
>>> $vehicle->model="Golf";
=> "Golf"
>>> $vehicle->year_of_manufacture="2012";
=> "2012"
>>> $vehicle->save();
=> true
当我切换到Sequel Pro时,数据不存储,但可以在我运行vehicle :: ScreenTec \ Models \ Vehicle :: find($ id);
时访问答案 0 :(得分:0)
原来SequelPro落后了,并没有在一张桌子上更新我数据的可视化表示。奇怪,但我已经重新启动了,现在就在那里!