tp5 model, and
in defining association
$order = Order::get(10);
$order->user //
//
public function user (){
return $this-hasOne("user","id","user_id");
}
users queried in this way will not be displayed if the delete_time in the deleted datasheet field is not null.
how to make the association method query all data, including soft deleted data
the following way of writing doesn"t work. Or can I only write related queries by myself?
public function user (){
return $this-hasOne("user","id","user_id")->withTrashed();
}