How can i create a file with the content in the default language?
https://getkirby.com/docs/reference/objects/page/create-file
This doesn’t seem to work
$user->createFile([
'source' => kirby()->root('site').'/payments/transaction.txt',
'filename' => $orderId . '.json',
'template' => 'transaction',
'translations' => [
[
'code' => 'nl',
'content' => [
'order_id' => $orderId,
'order_created' => $orderId,
'order_value' => $orderValue,
'order_credits' => $orderCredits,
'order_status' => $payment->status,
'user_id' => $user->id(),
'ip_address' => $ip,
'user_agent' => $userAgent,
],
],
]
]);
what currently is working is this:
$user->createFile([
'source' => kirby()->root('site').'/payments/transaction.txt',
'filename' => $orderId . '.json',
'template' => 'transaction',
'content' => [
'order_id' => $orderId,
'order_created' => $orderId,
'order_value' => $orderValue,
'order_credits' => $orderCredits,
'order_status' => $payment->status,
'user_id' => $user->id(),
'ip_address' => $ip,
'user_agent' => $userAgent,
],
]);
Many thanks!!