这是我的Laravel / Ardent模型。 我正在使用自动补水。
class Party extends \LaravelBook\Ardent\Ardent {
public $autoHydrateEntityFromInput = true;
public $forceEntityHydrationFromInput = true;
protected $guarded = array();
protected $table = 'Parties';
public $timestamps = true;
use SoftDeletingTrait;
protected $dates = ['deleted_at'];
public static $rules = array(
...
);
public static $relationsData = array(...);
我的控制器代码
public function postCreate()
{
$party = new Party;
$saveSuccess = $party->save();
if($saveSuccess)
{
return Response::json([
'status' => $saveSuccess
],
200
);
}
}
它不会抛出任何错误或异常。但数据也没有得到保存。可能是什么原因?