From 63740846b643bb54bfdfe7f320e130c72ebf3f64 Mon Sep 17 00:00:00 2001 From: Cornch Date: Sun, 30 Jun 2024 17:00:28 +0800 Subject: [PATCH 001/491] New translations artisan.pot (Chinese Traditional) --- po/zh_TW/artisan.po | 346 ++++++++++++++++++++++++++++++-------------- 1 file changed, 237 insertions(+), 109 deletions(-) diff --git a/po/zh_TW/artisan.po b/po/zh_TW/artisan.po index 02f43d972..ad28e69eb 100644 --- a/po/zh_TW/artisan.po +++ b/po/zh_TW/artisan.po @@ -10,7 +10,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Language-Team: Chinese Traditional\n" "Language: zh_TW\n" -"PO-Revision-Date: 2024-06-30 08:17\n" +"PO-Revision-Date: 2024-06-30 09:00\n" #: docs/10.x/artisan.md:block 1 (header) msgid "Artisan Console" @@ -65,8 +65,8 @@ msgid "[Input Descriptions](#input-descriptions)" msgstr "[輸入說明](#input-descriptions)" #: docs/10.x/artisan.md:block 2 (unordered list) -msgid "[Prompting For Missing Input](#prompting-for-missing-input)" -msgstr "[為未提供的輸入進行提示](#prompting-for-missing-input)" +msgid "[Prompting for Missing Input](#prompting-for-missing-input)" +msgstr "" #: docs/10.x/artisan.md:block 2 (unordered list) msgid "[Command I/O](#command-io)" @@ -77,8 +77,8 @@ msgid "[Retrieving Input](#retrieving-input)" msgstr "[取得輸入](#retrieving-input)" #: docs/10.x/artisan.md:block 2 (unordered list) -msgid "[Prompting For Input](#prompting-for-input)" -msgstr "[為輸入進行提示](#prompting-for-input)" +msgid "[Prompting for Input](#prompting-for-input)" +msgstr "" #: docs/10.x/artisan.md:block 2 (unordered list) msgid "[Writing Output](#writing-output)" @@ -161,8 +161,8 @@ msgid "composer require laravel/tinker\n" msgstr "composer require laravel/tinker\n" #: docs/10.x/artisan.md:block 20 (quote) -msgid "**Note** Looking for a graphical UI for interacting with your Laravel application? Check out [Tinkerwell](https://tinkerwell.app)!" -msgstr "**Note** 想找個能與你的 Laravel 應用程式互動的圖形化 UI 嗎?試試 [Tinkerwell](https://tinkerwell.app) 吧!" +msgid "[!NOTE] Looking for hot reloading, multiline code editing, and autocompletion when interacting with your Laravel application? Check out [Tinkerwell](https://tinkerwell.app)!" +msgstr "" #: docs/10.x/artisan.md:block 22 (header) msgid "Usage" @@ -185,8 +185,8 @@ msgid "php artisan vendor:publish --provider=\"Laravel\\Tinker\\TinkerServicePro msgstr "php artisan vendor:publish --provider=\"Laravel\\Tinker\\TinkerServiceProvider\"\n" #: docs/10.x/artisan.md:block 27 (quote) -msgid "**Warning** The `dispatch` helper function and `dispatch` method on the `Dispatchable` class depends on garbage collection to place the job on the queue. Therefore, when using tinker, you should use `Bus::dispatch` or `Queue::push` to dispatch jobs." -msgstr "**Warning** `dispatch` 輔助函式與 `Dispatchable` 類別上的 `dispatch` 方法需要仰賴垃圾回收機制來將任務放進佇列中。因此,在使用 Tinker 時,應使用 `Bus::dispatch` 或 `Queue::push` 來分派任務。" +msgid "[!WARNING] The `dispatch` helper function and `dispatch` method on the `Dispatchable` class depends on garbage collection to place the job on the queue. Therefore, when using tinker, you should use `Bus::dispatch` or `Queue::push` to dispatch jobs." +msgstr "" #: docs/10.x/artisan.md:block 29 (header) msgid "Command Allow List" @@ -309,8 +309,8 @@ msgstr " strlen($value) > 0\n" -" ? User::where('name', 'like', \"%{$value}%\")->pluck('name', 'id')\n" -" : []\n" -" ),\n" -"];\n" -msgstr "use App\\Models\\User;\n" -"use function Laravel\\Prompts\\search;\n\n" -"// ...\n\n" -"return [\n" -" 'user' => fn () => search(\n" -" label: 'Search for a user:',\n" -" placeholder: 'E.g. Taylor Otwell',\n" -" options: fn ($value) => strlen($value) > 0\n" -" ? User::where('name', 'like', \"%{$value}%\")->pluck('name', 'id')\n" +" ? User::where('name', 'like', \"%{$value}%\")->pluck('name', 'id')->all()\n" " : []\n" " ),\n" "];\n" +msgstr "" #: docs/10.x/artisan.md:block 138 (quote) -msgid "**Note** The comprehensive [Laravel Prompts](/docs/{{version}}/prompts) documentation includes additional information on the available prompts and their usage." -msgstr "**Note** 完整的 [Laravel Prompts](/docs/{{version}}/prompts) 說明文件中包含了有關可用的提示及其使用方法的更多資訊。" +msgid "[!NOTE] The comprehensive [Laravel Prompts](/docs/{{version}}/prompts) documentation includes additional information on the available prompts and their usage." +msgstr "" #: docs/10.x/artisan.md:block 139 (paragraph) msgid "If you wish to prompt the user to select or enter [options](#options), you may include prompts in your command's `handle` method. However, if you only wish to prompt the user when they have also been automatically prompted for missing arguments, then you may implement the `afterPromptingForMissingArguments` method:" @@ -897,12 +886,12 @@ msgstr "// 取得特定選項...\n" "$options = $this->options();\n" #: docs/10.x/artisan.md:block 152 (header) -msgid "Prompting For Input" -msgstr "為輸入進行提示" +msgid "Prompting for Input" +msgstr "" #: docs/10.x/artisan.md:block 153 (quote) -msgid "**Note** [Laravel Prompts](/docs/{{version}}/prompts) is a PHP package for adding beautiful and user-friendly forms to your command-line applications, with browser-like features including placeholder text and validation." -msgstr "**Note** [Laravel Prompts](/docs/{{version}}/prompts) 是一個 PHP 套件,可用來在 CLI 應用程式中新增好看且對使用者友善的表單,並具有類似瀏覽器中的功能,如預留位置文字與表單驗證。" +msgid "[!NOTE] [Laravel Prompts](/docs/{{version}}/prompts) is a PHP package for adding beautiful and user-friendly forms to your command-line applications, with browser-like features including placeholder text and validation." +msgstr "" #: docs/10.x/artisan.md:block 154 (paragraph) msgid "In addition to displaying output, you may also ask the user to provide input during the execution of your command. The `ask` method will prompt the user with the given question, accept their input, and then return the user's input back to your command:" @@ -927,22 +916,30 @@ msgstr "/**\n" "}\n" #: docs/10.x/artisan.md:block 156 (paragraph) +msgid "The `ask` method also accepts an optional second argument which specifies the default value that should be returned if no user input is provided:" +msgstr "" + +#: docs/10.x/artisan.md:block 157 (code) +msgid "$name = $this->ask('What is your name?', 'Taylor');\n" +msgstr "" + +#: docs/10.x/artisan.md:block 158 (paragraph) msgid "The `secret` method is similar to `ask`, but the user's input will not be visible to them as they type in the console. This method is useful when asking for sensitive information such as passwords:" msgstr "`secret` 方法與 `ask` 類似,但使用者在指令列輸入的過程中將看不到他們自己的輸入值。這個方法適用於像使用者詢問如密碼等機密資訊的時候:" -#: docs/10.x/artisan.md:block 157 (code) +#: docs/10.x/artisan.md:block 159 (code) msgid "$password = $this->secret('What is the password?');\n" msgstr "$password = $this->secret('What is the password?');\n" -#: docs/10.x/artisan.md:block 159 (header) -msgid "Asking For Confirmation" -msgstr "要求確認" +#: docs/10.x/artisan.md:block 161 (header) +msgid "Asking for Confirmation" +msgstr "" -#: docs/10.x/artisan.md:block 160 (paragraph) +#: docs/10.x/artisan.md:block 162 (paragraph) msgid "If you need to ask the user for a simple \"yes or no\" confirmation, you may use the `confirm` method. By default, this method will return `false`. However, if the user enters `y` or `yes` in response to the prompt, the method will return `true`." msgstr "若需要使用者回答簡單的「yes / no」的確認問題,可以使用 `confirm` 方法。預設情況下,這個方法會回傳 `false`,但若使用者在提示時輸入 `y` 或 `yes`,則該方法會回傳 `true`。" -#: docs/10.x/artisan.md:block 161 (code) +#: docs/10.x/artisan.md:block 163 (code) msgid "if ($this->confirm('Do you wish to continue?')) {\n" " // ...\n" "}\n" @@ -950,11 +947,11 @@ msgstr "if ($this->confirm('Do you wish to continue?')) {\n" " // ...\n" "}\n" -#: docs/10.x/artisan.md:block 162 (paragraph) +#: docs/10.x/artisan.md:block 164 (paragraph) msgid "If necessary, you may specify that the confirmation prompt should return `true` by default by passing `true` as the second argument to the `confirm` method:" msgstr "若有必要,也可以通過將 `true` 傳入為 `confirm` 方法的第二個引數來指定讓確認提示預設回傳 `true`:" -#: docs/10.x/artisan.md:block 163 (code) +#: docs/10.x/artisan.md:block 165 (code) msgid "if ($this->confirm('Do you wish to continue?', true)) {\n" " // ...\n" "}\n" @@ -962,23 +959,23 @@ msgstr "if ($this->confirm('Do you wish to continue?', true)) {\n" " // ...\n" "}\n" -#: docs/10.x/artisan.md:block 165 (header) +#: docs/10.x/artisan.md:block 167 (header) msgid "Auto-Completion" msgstr "自動補全" -#: docs/10.x/artisan.md:block 166 (paragraph) +#: docs/10.x/artisan.md:block 168 (paragraph) msgid "The `anticipate` method can be used to provide auto-completion for possible choices. The user can still provide any answer, regardless of the auto-completion hints:" msgstr "`anticipate` 方法可以用來為可能的選項提供自動補全。不論自動補全提示了什麼,使用者一樣可以提供任意回答:" -#: docs/10.x/artisan.md:block 167 (code) +#: docs/10.x/artisan.md:block 169 (code) msgid "$name = $this->anticipate('What is your name?', ['Taylor', 'Dayle']);\n" msgstr "$name = $this->anticipate('What is your name?', ['Taylor', 'Dayle']);\n" -#: docs/10.x/artisan.md:block 168 (paragraph) +#: docs/10.x/artisan.md:block 170 (paragraph) msgid "Alternatively, you may pass a closure as the second argument to the `anticipate` method. The closure will be called each time the user types an input character. The closure should accept a string parameter containing the user's input so far, and return an array of options for auto-completion:" msgstr "另外,也可以將一個閉包傳給 `anticipate` 方法的第二個引數。這個閉包會在每次使用者輸入字元的時候被呼叫。該閉包應接受一個字串參數,其中包含了目前使用者的輸入值,並回傳用於自動補全的選項陣列:" -#: docs/10.x/artisan.md:block 169 (code) +#: docs/10.x/artisan.md:block 171 (code) msgid "$name = $this->anticipate('What is your address?', function (string $input) {\n" " // Return auto-completion options...\n" "});\n" @@ -986,15 +983,15 @@ msgstr "$name = $this->anticipate('What is your address?', function (string $inp " // 回傳自動補全的選項...\n" "});\n" -#: docs/10.x/artisan.md:block 171 (header) +#: docs/10.x/artisan.md:block 173 (header) msgid "Multiple Choice Questions" msgstr "多重選擇問題" -#: docs/10.x/artisan.md:block 172 (paragraph) +#: docs/10.x/artisan.md:block 174 (paragraph) msgid "If you need to give the user a predefined set of choices when asking a question, you may use the `choice` method. You may set the array index of the default value to be returned if no option is chosen by passing the index as the third argument to the method:" msgstr "若需要在詢問問題時為提供使用者一組預先定義的選項,可以使用 `choice` 方法。也可以通過將預設選項的陣列索引傳給該方法的第三個參數,來指定沒有選擇任何選項時要回傳的預設值:" -#: docs/10.x/artisan.md:block 173 (code) +#: docs/10.x/artisan.md:block 175 (code) msgid "$name = $this->choice(\n" " 'What is your name?',\n" " ['Taylor', 'Dayle'],\n" @@ -1006,11 +1003,11 @@ msgstr "$name = $this->choice(\n" " $defaultIndex\n" ");\n" -#: docs/10.x/artisan.md:block 174 (paragraph) +#: docs/10.x/artisan.md:block 176 (paragraph) msgid "In addition, the `choice` method accepts optional fourth and fifth arguments for determining the maximum number of attempts to select a valid response and whether multiple selections are permitted:" msgstr "另外,`choice` 方法也接受第 4 個與第 5 個引數,這兩個引數分別是用來判斷選擇有效回答的最大嘗試次數,以及是否允許多重選擇:" -#: docs/10.x/artisan.md:block 175 (code) +#: docs/10.x/artisan.md:block 177 (code) msgid "$name = $this->choice(\n" " 'What is your name?',\n" " ['Taylor', 'Dayle'],\n" @@ -1026,15 +1023,15 @@ msgstr "$name = $this->choice(\n" " $allowMultipleSelections = false\n" ");\n" -#: docs/10.x/artisan.md:block 177 (header) +#: docs/10.x/artisan.md:block 179 (header) msgid "Writing Output" msgstr "撰寫輸出" -#: docs/10.x/artisan.md:block 178 (paragraph) +#: docs/10.x/artisan.md:block 180 (paragraph) msgid "To send output to the console, you may use the `line`, `info`, `comment`, `question`, `warn`, and `error` methods. Each of these methods will use appropriate ANSI colors for their purpose. For example, let's display some general information to the user. Typically, the `info` method will display in the console as green colored text:" msgstr "若要將輸出傳送至主控台,可以使用 `line`, `info`, `comment`, `question`, `warn` 與 `error` 方法。這幾個方法會依不同目的來使用適當的 ANSI 色彩。舉例來說,我們來顯示一些一般的資訊給使用者看。通常來說,`info` 方法會在主控台上顯示出綠色的文字:" -#: docs/10.x/artisan.md:block 179 (code) +#: docs/10.x/artisan.md:block 181 (code) msgid "/**\n" " * Execute the console command.\n" " */\n" @@ -1052,27 +1049,27 @@ msgstr "/**\n" " $this->info('The command was successful!');\n" "}\n" -#: docs/10.x/artisan.md:block 180 (paragraph) +#: docs/10.x/artisan.md:block 182 (paragraph) msgid "To display an error message, use the `error` method. Error message text is typically displayed in red:" msgstr "若要顯示錯誤訊息,可以使用 `error` 方法。錯誤訊息文字通常會以紅色顯示:" -#: docs/10.x/artisan.md:block 181 (code) +#: docs/10.x/artisan.md:block 183 (code) msgid "$this->error('Something went wrong!');\n" msgstr "$this->error('Something went wrong!');\n" -#: docs/10.x/artisan.md:block 182 (paragraph) +#: docs/10.x/artisan.md:block 184 (paragraph) msgid "You may use the `line` method to display plain, uncolored text:" msgstr "也可以使用 `line` 方法來顯示未標示色彩的純文字:" -#: docs/10.x/artisan.md:block 183 (code) +#: docs/10.x/artisan.md:block 185 (code) msgid "$this->line('Display this on the screen');\n" msgstr "$this->line('Display this on the screen');\n" -#: docs/10.x/artisan.md:block 184 (paragraph) +#: docs/10.x/artisan.md:block 186 (paragraph) msgid "You may use the `newLine` method to display a blank line:" msgstr "可以使用 `newLine` 方法來顯示空行:" -#: docs/10.x/artisan.md:block 185 (code) +#: docs/10.x/artisan.md:block 187 (code) msgid "// Write a single blank line...\n" "$this->newLine();\n\n" "// Write three blank lines...\n" @@ -1082,15 +1079,15 @@ msgstr "// 寫入一行空行...\n" "// 寫入三行空行...\n" "$this->newLine(3);\n" -#: docs/10.x/artisan.md:block 187 (header) +#: docs/10.x/artisan.md:block 189 (header) msgid "Tables" msgstr "表格" -#: docs/10.x/artisan.md:block 188 (paragraph) +#: docs/10.x/artisan.md:block 190 (paragraph) msgid "The `table` method makes it easy to correctly format multiple rows / columns of data. All you need to do is provide the column names and the data for the table and Laravel will automatically calculate the appropriate width and height of the table for you:" msgstr "通過 `table` 方法可以很輕鬆地正確為多行列資料進行格式化。只需要提供表格的欄位名稱與表格的資料,Laravel 就會自動計算適當的表格寬高:" -#: docs/10.x/artisan.md:block 189 (code) +#: docs/10.x/artisan.md:block 191 (code) msgid "use App\\Models\\User;\n\n" "$this->table(\n" " ['Name', 'Email'],\n" @@ -1102,15 +1099,15 @@ msgstr "use App\\Models\\User;\n\n" " User::all(['name', 'email'])->toArray()\n" ");\n" -#: docs/10.x/artisan.md:block 191 (header) +#: docs/10.x/artisan.md:block 193 (header) msgid "Progress Bars" msgstr "進度列" -#: docs/10.x/artisan.md:block 192 (paragraph) +#: docs/10.x/artisan.md:block 194 (paragraph) msgid "For long running tasks, it can be helpful to show a progress bar that informs users how complete the task is. Using the `withProgressBar` method, Laravel will display a progress bar and advance its progress for each iteration over a given iterable value:" msgstr "當有需要長時間執行的任務時,最好顯示一個能告訴使用者目前任務完成度的進度列。使用 `withProgressBar` 方法,Laravel 就會顯示出一個進度列,並在每次迭代過指定的迭代值時增加進度列的進度:" -#: docs/10.x/artisan.md:block 193 (code) +#: docs/10.x/artisan.md:block 195 (code) msgid "use App\\Models\\User;\n\n" "$users = $this->withProgressBar(User::all(), function (User $user) {\n" " $this->performTask($user);\n" @@ -1120,11 +1117,11 @@ msgstr "use App\\Models\\User;\n\n" " $this->performTask($user);\n" "});\n" -#: docs/10.x/artisan.md:block 194 (paragraph) +#: docs/10.x/artisan.md:block 196 (paragraph) msgid "Sometimes, you may need more manual control over how a progress bar is advanced. First, define the total number of steps the process will iterate through. Then, advance the progress bar after processing each item:" msgstr "有時候,我們可能需要手動控制進度列何時需要增加。首先,我們先定義整個過程所需要迭代的次數。接著,在每個項目處理完後增加進度:" -#: docs/10.x/artisan.md:block 195 (code) +#: docs/10.x/artisan.md:block 197 (code) msgid "$users = App\\Models\\User::all();\n\n" "$bar = $this->output->createProgressBar(count($users));\n\n" "$bar->start();\n\n" @@ -1142,19 +1139,19 @@ msgstr "$users = App\\Models\\User::all();\n\n" "}\n\n" "$bar->finish();\n" -#: docs/10.x/artisan.md:block 196 (quote) -msgid "**Note** For more advanced options, check out the [Symfony Progress Bar component documentation](https://symfony.com/doc/current/components/console/helpers/progressbar.html)." -msgstr "**Note** 有關更進階的選項,請參考 [Symfony Progress Bar 元件說明文件](https://symfony.com/doc/current/components/console/helpers/progressbar.html)。" +#: docs/10.x/artisan.md:block 198 (quote) +msgid "[!NOTE] For more advanced options, check out the [Symfony Progress Bar component documentation](https://symfony.com/doc/current/components/console/helpers/progressbar.html)." +msgstr "" -#: docs/10.x/artisan.md:block 198 (header) +#: docs/10.x/artisan.md:block 200 (header) msgid "Registering Commands" msgstr "註冊指令" -#: docs/10.x/artisan.md:block 199 (paragraph) +#: docs/10.x/artisan.md:block 201 (paragraph) msgid "All of your console commands are registered within your application's `App\\Console\\Kernel` class, which is your application's \"console kernel\". Within the `commands` method of this class, you will see a call to the kernel's `load` method. The `load` method will scan the `app/Console/Commands` directory and automatically register each command it contains with Artisan. You are even free to make additional calls to the `load` method to scan other directories for Artisan commands:" msgstr "所有主控台指令都在 `App\\Console\\Kernel` 類別內自動註冊。該類別為專案的「主控台核心」。在該類別的 `commands` 方法內,可以看到一個核心 `load` 方法的呼叫。`load` 方法會掃描 `app/Console/Commands` 目錄並自動向 Artisan 註冊其中的各個指令。你也可以在 `load` 方法中加上額外的呼叫來掃描其他目錄中的 Artisan 指令:" -#: docs/10.x/artisan.md:block 200 (code) +#: docs/10.x/artisan.md:block 202 (code) msgid "/**\n" " * Register the commands for the application.\n" " */\n" @@ -1174,11 +1171,11 @@ msgstr "/**\n" " // ...\n" "}\n" -#: docs/10.x/artisan.md:block 201 (paragraph) +#: docs/10.x/artisan.md:block 203 (paragraph) msgid "If necessary, you may manually register commands by adding the command's class name to a `$commands` property within your `App\\Console\\Kernel` class. If this property is not already defined on your kernel, you should define it manually. When Artisan boots, all the commands listed in this property will be resolved by the [service container](/docs/{{version}}/container) and registered with Artisan:" msgstr "若有需要的話,也可以通過將指令的類別名稱加至 `App\\Console\\Kernel` 類別的 `$commands` 屬性來手動註冊指令。若該屬性不存在,你可以手動建立。當 Artisan 啟動時,列在該屬性上的所有指令都會由 [Service Container](/docs/{{version}}/container) 進行解析,並向 Artisan 註冊:" -#: docs/10.x/artisan.md:block 202 (code) +#: docs/10.x/artisan.md:block 204 (code) msgid "protected $commands = [\n" " Commands\\SendEmails::class\n" "];\n" @@ -1186,15 +1183,15 @@ msgstr "protected $commands = [\n" " Commands\\SendEmails::class\n" "];\n" -#: docs/10.x/artisan.md:block 204 (header) +#: docs/10.x/artisan.md:block 206 (header) msgid "Programmatically Executing Commands" msgstr "通過程式碼執行指令" -#: docs/10.x/artisan.md:block 205 (paragraph) +#: docs/10.x/artisan.md:block 207 (paragraph) msgid "Sometimes you may wish to execute an Artisan command outside of the CLI. For example, you may wish to execute an Artisan command from a route or controller. You may use the `call` method on the `Artisan` facade to accomplish this. The `call` method accepts either the command's signature name or class name as its first argument, and an array of command parameters as the second argument. The exit code will be returned:" msgstr "有時候可能需要在 CLI 以外的地方執行 Artisan 指令。舉例來說,你可能會想在路由或控制器內執行 Artisan 指令。可以使用 `Artisan` Facade 的 `call` 方法來完成這一目標。可以傳入指令的簽章名稱或類別名稱給 `call` 方法的第一個引數,而指令的參數則可以陣列傳為第二個引數。指令的結束代碼(Exit Code)會被回傳:" -#: docs/10.x/artisan.md:block 206 (code) +#: docs/10.x/artisan.md:block 208 (code) msgid "use Illuminate\\Support\\Facades\\Artisan;\n\n" "Route::post('/user/{user}/mail', function (string $user) {\n" " $exitCode = Artisan::call('mail:send', [\n" @@ -1210,23 +1207,23 @@ msgstr "use Illuminate\\Support\\Facades\\Artisan;\n\n" " // ...\n" "});\n" -#: docs/10.x/artisan.md:block 207 (paragraph) +#: docs/10.x/artisan.md:block 209 (paragraph) msgid "Alternatively, you may pass the entire Artisan command to the `call` method as a string:" msgstr "或者,也可以將整個 Artisan 指令作為字串傳給 `call` 方法:" -#: docs/10.x/artisan.md:block 208 (code) +#: docs/10.x/artisan.md:block 210 (code) msgid "Artisan::call('mail:send 1 --queue=default');\n" msgstr "Artisan::call('mail:send 1 --queue=default');\n" -#: docs/10.x/artisan.md:block 210 (header) +#: docs/10.x/artisan.md:block 212 (header) msgid "Passing Array Values" msgstr "傳入陣列值" -#: docs/10.x/artisan.md:block 211 (paragraph) +#: docs/10.x/artisan.md:block 213 (paragraph) msgid "If your command defines an option that accepts an array, you may pass an array of values to that option:" msgstr "若指令有定義接受陣列的選項,則可將陣列傳給該選項:" -#: docs/10.x/artisan.md:block 212 (code) +#: docs/10.x/artisan.md:block 214 (code) msgid "use Illuminate\\Support\\Facades\\Artisan;\n\n" "Route::post('/mail', function () {\n" " $exitCode = Artisan::call('mail:send', [\n" @@ -1240,15 +1237,15 @@ msgstr "use Illuminate\\Support\\Facades\\Artisan;\n\n" " ]);\n" "});\n" -#: docs/10.x/artisan.md:block 214 (header) +#: docs/10.x/artisan.md:block 216 (header) msgid "Passing Boolean Values" msgstr "傳入布林值" -#: docs/10.x/artisan.md:block 215 (paragraph) +#: docs/10.x/artisan.md:block 217 (paragraph) msgid "If you need to specify the value of an option that does not accept string values, such as the `--force` flag on the `migrate:refresh` command, you should pass `true` or `false` as the value of the option:" msgstr "若有需要為不接受字串值的選項指定值,如 `migrate:refresh` 指令的 `--force` 旗標,則可以為該選項傳入 `true` 或 `false`:" -#: docs/10.x/artisan.md:block 216 (code) +#: docs/10.x/artisan.md:block 218 (code) msgid "$exitCode = Artisan::call('migrate:refresh', [\n" " '--force' => true,\n" "]);\n" @@ -1256,15 +1253,15 @@ msgstr "$exitCode = Artisan::call('migrate:refresh', [\n" " '--force' => true,\n" "]);\n" -#: docs/10.x/artisan.md:block 218 (header) +#: docs/10.x/artisan.md:block 220 (header) msgid "Queueing Artisan Commands" msgstr "將 Artisan 指令放入佇列" -#: docs/10.x/artisan.md:block 219 (paragraph) +#: docs/10.x/artisan.md:block 221 (paragraph) msgid "Using the `queue` method on the `Artisan` facade, you may even queue Artisan commands so they are processed in the background by your [queue workers](/docs/{{version}}/queues). Before using this method, make sure you have configured your queue and are running a queue listener:" msgstr "只需要使用 `Artisan` Facade 的 `queue` 方法,就可以將 Artisan 指令放入佇列執行,這樣這個指令就會在 [佇列背景工作角色](/docs/{{version}}/queues) 內背景執行。在使用該方法前,請先確認是否已設定好佇列,且有執行佇列監聽程式:" -#: docs/10.x/artisan.md:block 220 (code) +#: docs/10.x/artisan.md:block 222 (code) msgid "use Illuminate\\Support\\Facades\\Artisan;\n\n" "Route::post('/user/{user}/mail', function (string $user) {\n" " Artisan::queue('mail:send', [\n" @@ -1280,11 +1277,11 @@ msgstr "use Illuminate\\Support\\Facades\\Artisan;\n\n" " // ...\n" "});\n" -#: docs/10.x/artisan.md:block 221 (paragraph) +#: docs/10.x/artisan.md:block 223 (paragraph) msgid "Using the `onConnection` and `onQueue` methods, you may specify the connection or queue the Artisan command should be dispatched to:" msgstr "可以使用 `onConnection` 與 `onQueue` 方法來指定 Artisan 指令應分派到哪個連線或佇列上:" -#: docs/10.x/artisan.md:block 222 (code) +#: docs/10.x/artisan.md:block 224 (code) msgid "Artisan::queue('mail:send', [\n" " 'user' => 1, '--queue' => 'default'\n" "])->onConnection('redis')->onQueue('commands');\n" @@ -1292,15 +1289,15 @@ msgstr "Artisan::queue('mail:send', [\n" " 'user' => 1, '--queue' => 'default'\n" "])->onConnection('redis')->onQueue('commands');\n" -#: docs/10.x/artisan.md:block 224 (header) +#: docs/10.x/artisan.md:block 226 (header) msgid "Calling Commands From Other Commands" msgstr "在其他指令內執行指令" -#: docs/10.x/artisan.md:block 225 (paragraph) +#: docs/10.x/artisan.md:block 227 (paragraph) msgid "Sometimes you may wish to call other commands from an existing Artisan command. You may do so using the `call` method. This `call` method accepts the command name and an array of command arguments / options:" msgstr "有時候可能需要在現有 Artisan 指令內執行另一個指令。可以通過呼叫 `call` 方法來完成。`call` 方法接受指令名稱與指令的引數與選項:" -#: docs/10.x/artisan.md:block 226 (code) +#: docs/10.x/artisan.md:block 228 (code) msgid "/**\n" " * Execute the console command.\n" " */\n" @@ -1322,11 +1319,11 @@ msgstr "/**\n" " // ...\n" "}\n" -#: docs/10.x/artisan.md:block 227 (paragraph) +#: docs/10.x/artisan.md:block 229 (paragraph) msgid "If you would like to call another console command and suppress all of its output, you may use the `callSilently` method. The `callSilently` method has the same signature as the `call` method:" msgstr "若有需要呼叫另一個主控台指令並忽略其所有輸出,則可使用 `callSilently` 方法。`callSilently` 方法的簽章與 `call` 方法相同:" -#: docs/10.x/artisan.md:block 228 (code) +#: docs/10.x/artisan.md:block 230 (code) msgid "$this->callSilently('mail:send', [\n" " 'user' => 1, '--queue' => 'default'\n" "]);\n" @@ -1334,15 +1331,15 @@ msgstr "$this->callSilently('mail:send', [\n" " 'user' => 1, '--queue' => 'default'\n" "]);\n" -#: docs/10.x/artisan.md:block 230 (header) +#: docs/10.x/artisan.md:block 232 (header) msgid "Signal Handling" msgstr "處理訊號" -#: docs/10.x/artisan.md:block 231 (paragraph) +#: docs/10.x/artisan.md:block 233 (paragraph) msgid "As you may know, operating systems allow signals to be sent to running processes. For example, the `SIGTERM` signal is how operating systems ask a program to terminate. If you wish to listen for signals in your Artisan console commands and execute code when they occur, you may use the `trap` method:" msgstr "讀者可能已經知道,在作業系統中,我們可以傳送訊號 (Signal) 給正在執行的處理程序。舉例來說,作業系統會使用 `SIGTERM` 訊號來要求某個程式停止執行。若想在 Artisan 主控台指令上監聽這些訊號,可使用 `trap` 方法:" -#: docs/10.x/artisan.md:block 232 (code) +#: docs/10.x/artisan.md:block 234 (code) msgid "/**\n" " * Execute the console command.\n" " */\n" @@ -1364,11 +1361,11 @@ msgstr "/**\n" " }\n" "}\n" -#: docs/10.x/artisan.md:block 233 (paragraph) +#: docs/10.x/artisan.md:block 235 (paragraph) msgid "To listen for multiple signals at once, you may provide an array of signals to the `trap` method:" msgstr "若要同時監聽多個訊號,可提供一組訊號的陣列給 `trap` 方法:" -#: docs/10.x/artisan.md:block 234 (code) +#: docs/10.x/artisan.md:block 236 (code) msgid "$this->trap([SIGTERM, SIGQUIT], function (int $signal) {\n" " $this->shouldKeepRunning = false;\n\n" " dump($signal); // SIGTERM / SIGQUIT\n" @@ -1378,30 +1375,123 @@ msgstr "$this->trap([SIGTERM, SIGQUIT], function (int $signal) {\n" " dump($signal); // SIGTERM / SIGQUIT\n" "});\n" -#: docs/10.x/artisan.md:block 236 (header) +#: docs/10.x/artisan.md:block 238 (header) msgid "Stub Customization" msgstr "自訂 Stub" -#: docs/10.x/artisan.md:block 237 (paragraph) +#: docs/10.x/artisan.md:block 239 (paragraph) msgid "The Artisan console's `make` commands are used to create a variety of classes, such as controllers, jobs, migrations, and tests. These classes are generated using \"stub\" files that are populated with values based on your input. However, you may want to make small changes to files generated by Artisan. To accomplish this, you may use the `stub:publish` command to publish the most common stubs to your application so that you can customize them:" msgstr "Artisan 主控台的 `make` 指令可以用來建立各種類別,如控制器、任務、資料庫遷移,以及測試。這些類別都是使用「Stub (虛設常式)」來產生的,Stub 會依據給定的輸入來填入不同的值。不過,你可能會想對這些 Artisan 產生的檔案做一些微調。要修改這些 Stub,可以通過 `stub:publish` 指令來將這些最常見的 Stub 安裝到專案中,如此一來就能自訂這些 Stub:" -#: docs/10.x/artisan.md:block 238 (code) +#: docs/10.x/artisan.md:block 240 (code) msgid "php artisan stub:publish\n" msgstr "php artisan stub:publish\n" -#: docs/10.x/artisan.md:block 239 (paragraph) +#: docs/10.x/artisan.md:block 241 (paragraph) msgid "The published stubs will be located within a `stubs` directory in the root of your application. Any changes you make to these stubs will be reflected when you generate their corresponding classes using Artisan's `make` commands." msgstr "安裝的 Stub 會被放在專案根目錄的 `stubs` 目錄中。對這些 Stub 做出的任何改動都會反應到使用 Artisan 的 `make` 指令所產生的對應類別上。" -#: docs/10.x/artisan.md:block 241 (header) +#: docs/10.x/artisan.md:block 243 (header) msgid "Events" msgstr "事件" -#: docs/10.x/artisan.md:block 242 (paragraph) +#: docs/10.x/artisan.md:block 244 (paragraph) msgid "Artisan dispatches three events when running commands: `Illuminate\\Console\\Events\\ArtisanStarting`, `Illuminate\\Console\\Events\\CommandStarting`, and `Illuminate\\Console\\Events\\CommandFinished`. The `ArtisanStarting` event is dispatched immediately when Artisan starts running. Next, the `CommandStarting` event is dispatched immediately before a command runs. Finally, the `CommandFinished` event is dispatched once a command finishes executing." msgstr "Artisan 會在執行指令的時候分派三個事件: `Illuminate\\Console\\Events\\ArtisanStarting`, `Illuminate\\Console\\Events\\CommandStarting` 與 `Illuminate\\Console\\Events\\CommandFinished`。`ArtisanStarting` 事件會在 Artisan 開始執行後馬上被分派。接著,`CommandStarting` 事件會在指令開始執行前的瞬間被分派。最後,`CommandFinished` 事件會在指令完成執行後被分派。" +#: docs/11.x/artisan.md:block 50 (header) +msgid "Exit Codes" +msgstr "" + +#: docs/11.x/artisan.md:block 51 (paragraph) +msgid "If nothing is returned from the `handle` method and the command executes successfully, the command will exit with a `0` exit code, indicating success. However, the `handle` method may optionally return an integer to manually specify command's exit code:" +msgstr "" + +#: docs/11.x/artisan.md:block 52 (code) +msgid "$this->error('Something went wrong.');\n\n" +"return 1;\n" +msgstr "" + +#: docs/11.x/artisan.md:block 53 (paragraph) +msgid "If you would like to \"fail\" the command from any method within the command, you may utilize the `fail` method. The `fail` method will immediately terminate execution of the command and return an exit code of `1`:" +msgstr "" + +#: docs/11.x/artisan.md:block 54 (code) +msgid "$this->fail('Something went wrong.');\n" +msgstr "" + +#: docs/11.x/artisan.md:block 57 (paragraph) +msgid "Closure based commands provide an alternative to defining console commands as classes. In the same way that route closures are an alternative to controllers, think of command closures as an alternative to command classes." +msgstr "" + +#: docs/11.x/artisan.md:block 58 (paragraph) +msgid "Even though the `routes/console.php` file does not define HTTP routes, it defines console based entry points (routes) into your application. Within this file, you may define all of your closure based console commands using the `Artisan::command` method. The `command` method accepts two arguments: the [command signature](#defining-input-expectations) and a closure which receives the command's arguments and options:" +msgstr "" + +#: docs/11.x/artisan.md:block 138 (code) +msgid "/**\n" +" * Prompt for missing input arguments using the returned questions.\n" +" *\n" +" * @return array\n" +" */\n" +"protected function promptForMissingArgumentsUsing(): array\n" +"{\n" +" return [\n" +" 'user' => 'Which user ID should receive the mail?',\n" +" ];\n" +"}\n" +msgstr "" + +#: docs/11.x/artisan.md:block 145 (code) +msgid "use Symfony\\Component\\Console\\Input\\InputInterface;\n" +"use Symfony\\Component\\Console\\Output\\OutputInterface;\n" +"use function Laravel\\Prompts\\confirm;\n\n" +"// ...\n\n" +"/**\n" +" * Perform actions after the user was prompted for missing arguments.\n" +" */\n" +"protected function afterPromptingForMissingArguments(InputInterface $input, OutputInterface $output): void\n" +"{\n" +" $input->setOption('queue', confirm(\n" +" label: 'Would you like to queue the mail?',\n" +" default: $this->option('queue')\n" +" ));\n" +"}\n" +msgstr "" + +#: docs/11.x/artisan.md:block 203 (quote) +msgid "[!NOTE] For more advanced options, check out the [Symfony Progress Bar component documentation](https://symfony.com/doc/7.0/components/console/helpers/progressbar.html)." +msgstr "" + +#: docs/11.x/artisan.md:block 206 (paragraph) +msgid "By default, Laravel automatically registers all commands within the `app/Console/Commands` directory. However, you can instruct Laravel to scan other directories for Artisan commands using the `withCommands` method in your application's `bootstrap/app.php` file:" +msgstr "" + +#: docs/11.x/artisan.md:block 207 (code) +msgid "->withCommands([\n" +" __DIR__.'/../app/Domain/Orders/Commands',\n" +"])\n" +msgstr "" + +#: docs/11.x/artisan.md:block 208 (paragraph) +msgid "If necessary, you may also manually register commands by providing the command's class name to the `withCommands` method:" +msgstr "" + +#: docs/11.x/artisan.md:block 209 (code) +msgid "use App\\Domain\\Orders\\Commands\\SendEmails;\n\n" +"->withCommands([\n" +" SendEmails::class,\n" +"])\n" +msgstr "" + +#: docs/11.x/artisan.md:block 210 (paragraph) +msgid "When Artisan boots, all the commands in your application will be resolved by the [service container](/docs/{{version}}/container) and registered with Artisan." +msgstr "" + +#: docs/8.x/artisan.md:block 2 (unordered list) +msgid "[Prompting For Input](#prompting-for-input)" +msgstr "[為輸入進行提示](#prompting-for-input)" + #: docs/8.x/artisan.md:block 12 (code) msgid "./sail artisan list\n" msgstr "./sail artisan list\n" @@ -1616,6 +1706,10 @@ msgstr "/**\n" " //\n" "}\n" +#: docs/8.x/artisan.md:block 120 (header) +msgid "Prompting For Input" +msgstr "為輸入進行提示" + #: docs/8.x/artisan.md:block 122 (code) msgid "/**\n" " * Execute the console command.\n" @@ -1636,6 +1730,10 @@ msgstr "/**\n" " $name = $this->ask('What is your name?');\n" "}\n" +#: docs/8.x/artisan.md:block 126 (header) +msgid "Asking For Confirmation" +msgstr "要求確認" + #: docs/8.x/artisan.md:block 128 (code) msgid "if ($this->confirm('Do you wish to continue?')) {\n" " //\n" @@ -1848,6 +1946,14 @@ msgstr "addMinutes(5);\n" "}\n" +#: docs/9.x/artisan.md:block 178 (quote) +msgid "**Note** For more advanced options, check out the [Symfony Progress Bar component documentation](https://symfony.com/doc/current/components/console/helpers/progressbar.html)." +msgstr "**Note** 有關更進階的選項,請參考 [Symfony Progress Bar 元件說明文件](https://symfony.com/doc/current/components/console/helpers/progressbar.html)。" + #: docs/9.x/artisan.md:block 214 (code) msgid "/**\n" " * Execute the console command.\n" @@ -1966,3 +2084,13 @@ msgstr "$this->trap([SIGTERM, SIGQUIT], function ($signal) {\n" " dump($signal); // SIGTERM / SIGQUIT\n" "});\n" +#: docs/master/artisan.md:block 52 (paragraph) +msgid "Even though the `routes/console.php` file file does not define HTTP routes, it defines console based entry points (routes) into your application. Within this file, you may define all of your closure based console commands using the `Artisan::command` method. The `command` method accepts two arguments: the [command signature](#defining-input-expectations) and a closure which receives the command's arguments and options:" +msgstr "" + +#: docs/master/artisan.md:block 201 (code) +msgid "->withCommands([\n" +" __DIR__.'../app/Domain/Orders/Commands',\n" +"])\n" +msgstr "" + From dc2d89ea6bf052db1f5c0f120252aa101f7529fe Mon Sep 17 00:00:00 2001 From: Cornch Date: Sun, 30 Jun 2024 17:00:29 +0800 Subject: [PATCH 002/491] New translations authentication.pot (Chinese Traditional) --- po/zh_TW/authentication.po | 521 ++++++++++++++++++++++++------------- 1 file changed, 336 insertions(+), 185 deletions(-) diff --git a/po/zh_TW/authentication.po b/po/zh_TW/authentication.po index b92c1e67b..144e3579c 100644 --- a/po/zh_TW/authentication.po +++ b/po/zh_TW/authentication.po @@ -10,7 +10,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Language-Team: Chinese Traditional\n" "Language: zh_TW\n" -"PO-Revision-Date: 2024-06-30 08:17\n" +"PO-Revision-Date: 2024-06-30 09:00\n" #: docs/10.x/authentication.md:block 1 (header) msgid "Authentication" @@ -37,12 +37,12 @@ msgid "[Authentication Quickstart](#authentication-quickstart)" msgstr "[「驗證」快速入門](#authentication-quickstart)" #: docs/10.x/authentication.md:block 2 (unordered list) -msgid "[Install A Starter Kit](#install-a-starter-kit)" -msgstr "[安裝入門套件](#install-a-starter-kit)" +msgid "[Install a Starter Kit](#install-a-starter-kit)" +msgstr "" #: docs/10.x/authentication.md:block 2 (unordered list) -msgid "[Retrieving The Authenticated User](#retrieving-the-authenticated-user)" -msgstr "[取得已登入的使用者](#retrieving-the-authenticated-user)" +msgid "[Retrieving the Authenticated User](#retrieving-the-authenticated-user)" +msgstr "" #: docs/10.x/authentication.md:block 2 (unordered list) msgid "[Protecting Routes](#protecting-routes)" @@ -77,8 +77,8 @@ msgid "[Logging Out](#logging-out)" msgstr "[登出](#logging-out)" #: docs/10.x/authentication.md:block 2 (unordered list) -msgid "[Invalidating Sessions On Other Devices](#invalidating-sessions-on-other-devices)" -msgstr "[登出其他裝置上的工作階段](#invalidating-sessions-on-other-devices)" +msgid "[Invalidating Sessions on Other Devices](#invalidating-sessions-on-other-devices)" +msgstr "" #: docs/10.x/authentication.md:block 2 (unordered list) msgid "[Password Confirmation](#password-confirmation)" @@ -145,8 +145,8 @@ msgid "Your application's authentication configuration file is located at `confi msgstr "你的專案的認證設定檔位於 `config/auth.php` 內。該檔案包含了多個有文件說明的選項,可以調整 Laravel 認證服務的行為。" #: docs/10.x/authentication.md:block 9 (quote) -msgid "**Note** Guards and providers should not be confused with \"roles\" and \"permissions\". To learn more about authorizing user actions via permissions, please refer to the [authorization](/docs/{{version}}/authorization) documentation." -msgstr "**Note** Guard 與 Provider 與「角色」以及「權限」不同,不應溷肴。要瞭解如何依照權限來授權使用者的方法,請參考 [授權](/docs/{{version}}/authorization) 說明文件。" +msgid "[!NOTE] Guards and providers should not be confused with \"roles\" and \"permissions\". To learn more about authorizing user actions via permissions, please refer to the [authorization](/docs/{{version}}/authorization) documentation." +msgstr "" #: docs/10.x/authentication.md:block 11 (header) msgid "Starter Kits" @@ -253,8 +253,8 @@ msgid "Laravel Sanctum is the API package we have chosen to include with the [La msgstr "Laravel Sanctum 是我們在 [Laravel Jetstream](https://jetstream.laravel.com) 專案入門套件中選擇的 API 套件,因為我們認為該套件最符合大多數網頁 App 的認證需求。" #: docs/10.x/authentication.md:block 42 (header) -msgid "Summary & Choosing Your Stack" -msgstr "總結與選擇你的 Stack" +msgid "Summary and Choosing Your Stack" +msgstr "" #: docs/10.x/authentication.md:block 43 (paragraph) msgid "In summary, if your application will be accessed using a browser and you are building a monolithic Laravel application, your application will use Laravel's built-in authentication services." @@ -281,12 +281,12 @@ msgid "Authentication Quickstart" msgstr "「認證」快速入門" #: docs/10.x/authentication.md:block 50 (quote) -msgid "**Warning** This portion of the documentation discusses authenticating users via the [Laravel application starter kits](/docs/{{version}}/starter-kits), which includes UI scaffolding to help you get started quickly. If you would like to integrate with Laravel's authentication systems directly, check out the documentation on [manually authenticating users](#authenticating-users)." -msgstr "**Warning** 這部分的文件會討論通過 [Laravel 應用程式入門套件](/docs/{{version}}/starter-kits) 來驗證使用者,這些入門套件包含了能協助你快速開始的 UI Scaffolding。若你想要直接與 Laravel 的驗證系統整合,請參考 [手動驗證使用者](#authenticating-users) 內的說明文件。" +msgid "[!WARNING] This portion of the documentation discusses authenticating users via the [Laravel application starter kits](/docs/{{version}}/starter-kits), which includes UI scaffolding to help you get started quickly. If you would like to integrate with Laravel's authentication systems directly, check out the documentation on [manually authenticating users](#authenticating-users)." +msgstr "" #: docs/10.x/authentication.md:block 52 (header) -msgid "Install A Starter Kit" -msgstr "安裝一種入門套件" +msgid "Install a Starter Kit" +msgstr "" #: docs/10.x/authentication.md:block 53 (paragraph) msgid "First, you should [install a Laravel application starter kit](/docs/{{version}}/starter-kits). Our current starter kits, Laravel Breeze and Laravel Jetstream, offer beautifully designed starting points for incorporating authentication into your fresh Laravel application." @@ -301,8 +301,8 @@ msgid "[Laravel Jetstream](https://jetstream.laravel.com) is a more robust appli msgstr "[Laravel Jetstream](https://jetstream.laravel.com) 是一個更複雜的專案入門套件,其中包含了使用 [Livewire](https://livewire.laravel.com) 或 [Inertia 與 Vue](https://inertiajs.com) 來對應用程式 Scaffolding 的支援。此外,Jetstream 也提供了對二步驟認證、團隊、個人檔案管理、瀏覽器啟程管理、通過 [Laravel Sanctum](/docs/{{version}}/sanctum) 提供的 API 支援、帳號刪除…等功能的可選支援。" #: docs/10.x/authentication.md:block 57 (header) -msgid "Retrieving The Authenticated User" -msgstr "取得已登入的使用者" +msgid "Retrieving the Authenticated User" +msgstr "" #: docs/10.x/authentication.md:block 58 (paragraph) msgid "After installing an authentication starter kit and allowing users to register and authenticate with your application, you will often need to interact with the currently authenticated user. While handling an incoming request, you may access the authenticated user via the `Auth` facade's `user` method:" @@ -359,8 +359,8 @@ msgstr "login($user);\n" msgstr "Auth::guard('admin')->login($user);\n" #: docs/10.x/authentication.md:block 124 (header) -msgid "Authenticate A User By ID" -msgstr "通過 ID 認證使用者" +msgid "Authenticate a User by ID" +msgstr "" #: docs/10.x/authentication.md:block 125 (paragraph) msgid "To authenticate a user using their database record's primary key, you may use the `loginUsingId` method. This method accepts the primary key of the user you wish to authenticate:" @@ -705,8 +705,8 @@ msgid "Auth::loginUsingId(1, $remember = true);\n" msgstr "Auth::loginUsingId(1, $remember = true);\n" #: docs/10.x/authentication.md:block 130 (header) -msgid "Authenticate A User Once" -msgstr "僅認證使用者一次" +msgid "Authenticate a User Once" +msgstr "" #: docs/10.x/authentication.md:block 131 (paragraph) msgid "You may use the `once` method to authenticate a user with the application for a single request. No sessions or cookies will be utilized when calling this method:" @@ -741,8 +741,8 @@ msgid "Once the middleware has been attached to the route, you will automaticall msgstr "將該 Middleware 加到路由上後,在瀏覽器上存取該路由時會自動被提示帳號密碼。預設情況下,`auth.basic` 中間層會假設 `email` 欄位是 `users` 資料表中的使用者「帳號」欄位。" #: docs/10.x/authentication.md:block 139 (header) -msgid "A Note On FastCGI" -msgstr "FastCGI 備註" +msgid "A Note on FastCGI" +msgstr "" #: docs/10.x/authentication.md:block 140 (paragraph) msgid "If you are using PHP FastCGI and Apache to serve your Laravel application, HTTP Basic authentication may not work correctly. To correct these problems, the following lines may be added to your application's `.htaccess` file:" @@ -853,8 +853,8 @@ msgstr "use Illuminate\\Http\\Request;\n" "}\n" #: docs/10.x/authentication.md:block 154 (header) -msgid "Invalidating Sessions On Other Devices" -msgstr "將其他裝置上的 Session 無效化" +msgid "Invalidating Sessions on Other Devices" +msgstr "" #: docs/10.x/authentication.md:block 155 (paragraph) msgid "Laravel also provides a mechanism for invalidating and \"logging out\" a user's sessions that are active on other devices without invalidating the session on their current device. This feature is typically utilized when a user is changing or updating their password and you would like to invalidate sessions on other devices while keeping the current device authenticated." @@ -899,8 +899,8 @@ msgid "While building your application, you may occasionally have actions that s msgstr "在製作網站時,有時可能會需要使用者在執行某個操作前、或是在使用者被重新導向到網站機敏區域前要求使用者確認密碼。Laravel 提供了一個內建的 Middleware 來讓這個過程變得很輕鬆。要實作這項功能會需要定義兩個路由:一個用於顯示並要求使用者確認密碼的路由,另一個則用於確認密碼有效並將使用者重新導向至預期目的地的路由。" #: docs/10.x/authentication.md:block 164 (quote) -msgid "**Note** The following documentation discusses how to integrate with Laravel's password confirmation features directly; however, if you would like to get started more quickly, the [Laravel application starter kits](/docs/{{version}}/starter-kits) include support for this feature!" -msgstr "**Note** 下列說明文件討論了如何直接整合 Laravel 的密碼確認功能。但若想更快速地入門, [Laravel 專案入門套件](/docs/{{version}}/starter-kits) 有內建支援這個功能!" +msgid "[!NOTE] The following documentation discusses how to integrate with Laravel's password confirmation features directly; however, if you would like to get started more quickly, the [Laravel application starter kits](/docs/{{version}}/starter-kits) include support for this feature!" +msgstr "" #: docs/10.x/authentication.md:block 166 (header) msgid "Configuration" @@ -935,8 +935,8 @@ msgid "As you might expect, the view that is returned by this route should have msgstr "跟我們預期的一樣,這個路由所回傳的 View 內應有一個含有 `password` 欄位的表單。此外,我們也可以隨意在該 View 中加上文字說明,來告訴使用者他們正在進入網站中受保護的區域,必須要輸入密碼來進行確認。" #: docs/10.x/authentication.md:block 176 (header) -msgid "Confirming The Password" -msgstr "確認密碼" +msgid "Confirming the Password" +msgstr "" #: docs/10.x/authentication.md:block 177 (paragraph) msgid "Next, we will define a route that will handle the form request from the \"confirm password\" view. This route will be responsible for validating the password and redirecting the user to their intended destination:" @@ -1395,6 +1395,233 @@ msgstr "/**\n" " ],\n" "];\n" +#: docs/11.x/authentication.md:block 2 (unordered list) +msgid "[Automatic Password Rehashing](#automatic-password-rehashing)" +msgstr "" + +#: docs/11.x/authentication.md:block 69 (paragraph) +msgid "[Route middleware](/docs/{{version}}/middleware) can be used to only allow authenticated users to access a given route. Laravel ships with an `auth` middleware, which is a [middleware alias](/docs/{{version}}/middleware#middleware-alias) for the `Illuminate\\Auth\\Middleware\\Authenticate` class. Since this middleware is already aliased internally by Laravel, all you need to do is attach the middleware to a route definition:" +msgstr "" + +#: docs/11.x/authentication.md:block 73 (paragraph) +msgid "When the `auth` middleware detects an unauthenticated user, it will redirect the user to the `login` [named route](/docs/{{version}}/routing#named-routes). You may modify this behavior using the method `redirectGuestsTo` of your application's `bootstrap/app.php` file:" +msgstr "" + +#: docs/11.x/authentication.md:block 74 (code) +msgid "use Illuminate\\Http\\Request;\n\n" +"->withMiddleware(function (Middleware $middleware) {\n" +" $middleware->redirectGuestsTo('/login');\n\n" +" // Using a closure...\n" +" $middleware->redirectGuestsTo(fn (Request $request) => route('login'));\n" +"})\n" +msgstr "" + +#: docs/11.x/authentication.md:block 156 (paragraph) +msgid "Before getting started, you should make sure that the `Illuminate\\Session\\Middleware\\AuthenticateSession` middleware is included on the routes that should receive session authentication. Typically, you should place this middleware on a route group definition so that it can be applied to the majority of your application's routes. By default, the `AuthenticateSession` middleware may be attached to a route using the `auth.session` [middleware alias](/docs/{{version}}/middleware#middleware-alias):" +msgstr "" + +#: docs/11.x/authentication.md:block 186 (paragraph) +msgid "You may define your own authentication guards using the `extend` method on the `Auth` facade. You should place your call to the `extend` method within a [service provider](/docs/{{version}}/providers). Since Laravel already ships with an `AppServiceProvider`, we can place the code in that provider:" +msgstr "" + +#: docs/11.x/authentication.md:block 187 (code) +msgid "token)->first();\n" +" });\n" +"}\n" +msgstr "" + +#: docs/11.x/authentication.md:block 202 (code) +msgid "make('mongo.connection'));\n" +" });\n" +" }\n" +"}\n" +msgstr "" + +#: docs/11.x/authentication.md:block 211 (code) +msgid " false,\n" +msgstr "" + +#: docs/11.x/authentication.md:block 234 (paragraph) +msgid "Laravel dispatches a variety of [events](/docs/{{version}}/events) during the authentication process. You may [define listeners](/docs/{{version}}/events) for any of the following events:" +msgstr "" + +#: docs/11.x/authentication.md:block 235 (table) +msgid "Event Name" +msgstr "" + +#: docs/11.x/authentication.md:block 235 (table) +msgid "`Illuminate\\Auth\\Events\\Registered`" +msgstr "" + +#: docs/11.x/authentication.md:block 235 (table) +msgid "`Illuminate\\Auth\\Events\\Attempting`" +msgstr "" + +#: docs/11.x/authentication.md:block 235 (table) +msgid "`Illuminate\\Auth\\Events\\Authenticated`" +msgstr "" + +#: docs/11.x/authentication.md:block 235 (table) +msgid "`Illuminate\\Auth\\Events\\Login`" +msgstr "" + +#: docs/11.x/authentication.md:block 235 (table) +msgid "`Illuminate\\Auth\\Events\\Failed`" +msgstr "" + +#: docs/11.x/authentication.md:block 235 (table) +msgid "`Illuminate\\Auth\\Events\\Validated`" +msgstr "" + +#: docs/11.x/authentication.md:block 235 (table) +msgid "`Illuminate\\Auth\\Events\\Verified`" +msgstr "" + +#: docs/11.x/authentication.md:block 235 (table) +msgid "`Illuminate\\Auth\\Events\\Logout`" +msgstr "" + +#: docs/11.x/authentication.md:block 235 (table) +msgid "`Illuminate\\Auth\\Events\\CurrentDeviceLogout`" +msgstr "" + +#: docs/11.x/authentication.md:block 235 (table) +msgid "`Illuminate\\Auth\\Events\\OtherDeviceLogout`" +msgstr "" + +#: docs/11.x/authentication.md:block 235 (table) +msgid "`Illuminate\\Auth\\Events\\Lockout`" +msgstr "" + +#: docs/11.x/authentication.md:block 235 (table) +msgid "`Illuminate\\Auth\\Events\\PasswordReset`" +msgstr "" + +#: docs/8.x/authentication.md:block 2 (unordered list) +msgid "[Install A Starter Kit](#install-a-starter-kit)" +msgstr "[安裝入門套件](#install-a-starter-kit)" + +#: docs/8.x/authentication.md:block 2 (unordered list) +msgid "[Retrieving The Authenticated User](#retrieving-the-authenticated-user)" +msgstr "[取得已登入的使用者](#retrieving-the-authenticated-user)" + +#: docs/8.x/authentication.md:block 2 (unordered list) +msgid "[Invalidating Sessions On Other Devices](#invalidating-sessions-on-other-devices)" +msgstr "[登出其他裝置上的工作階段](#invalidating-sessions-on-other-devices)" + #: docs/8.x/authentication.md:block 9 (quote) msgid "{tip} Guards and providers should not be confused with \"roles\" and \"permissions\". To learn more about authorizing user actions via permissions, please refer to the [authorization](/docs/{{version}}/authorization) documentation." msgstr "{tip} Guard 與 Provider 跟「角色」以及「權限」不同,不應混謠。若要瞭解如何依照權限來授權使用者的方法,請參考[授權](/docs/{{version}}/authorization) 說明文件。" @@ -1403,6 +1630,10 @@ msgstr "{tip} Guard 與 Provider 跟「角色」以及「權限」不同,不 msgid "*[Laravel Jetstream](https://jetstream.laravel.com)* is a robust application starter kit that consumes and exposes Laravel Fortify's authentication services with a beautiful, modern UI powered by [Tailwind CSS](https://tailwindcss.com), [Livewire](https://laravel-livewire.com), and / or [Inertia.js](https://inertiajs.com). Laravel Jetstream includes optional support for two-factor authentication, team support, browser session management, profile management, and built-in integration with [Laravel Sanctum](/docs/{{version}}/sanctum) to offer API token authentication. Laravel's API authentication offerings are discussed below." msgstr "**[Laravel Jetstream](https://jetstream.laravel.com)** 是一個強大的入門套件,該套件使用者 Laravel Fortify 的驗證服務,並將其通過 [Tailwind CSS](https://tailwindcss.com), [Livewire](https://laravel-livewire.com),與/或 [Inertia.js](https://inertiajs.com) 來提供美麗且現代的 UI。Laravel Jetstream 也提供了對二步驟驗證、團隊支援、瀏覽器啟程管理、個人檔案管理、以及內建與 [Laravel Sanctum](/docs/{{version}}/sunctum) 整合來提供 API 權杖驗證的可選支援。Laravel 提供的 API 驗證功能將在下方討論。" +#: docs/8.x/authentication.md:block 42 (header) +msgid "Summary & Choosing Your Stack" +msgstr "總結與選擇你的 Stack" + #: docs/8.x/authentication.md:block 47 (paragraph) msgid "And, if you would like to get started quickly, we are pleased to recommend [Laravel Jetstream](https://jetstream.laravel.com) as a quick way to start a new Laravel application that already uses our preferred authentication stack of Laravel's built-in authentication services and Laravel Sanctum." msgstr "此外,若想要快速入門,我們誠摯推薦你使用 [Laravel Jetstream](https://jetstream.laravel.com) 來作為快速建立新 Laravel 專案的方法。Laravel Jetstream 已經使用了我們偏好的認證 Stack —— 使用 Laravel 的內建認證服務與 Laravel Sanctum。" @@ -1411,6 +1642,10 @@ msgstr "此外,若想要快速入門,我們誠摯推薦你使用 [Laravel Je msgid "{note} This portion of the documentation discusses authenticating users via the [Laravel application starter kits](/docs/{{version}}/starter-kits), which includes UI scaffolding to help you get started quickly. If you would like to integrate with Laravel's authentication systems directly, check out the documentation on [manually authenticating users](#authenticating-users)." msgstr "{note} 這部分的文件會討論通過 [Laravel 應用程式入門套件](/docs/{{version}}/starter-kits) 來驗證使用者,這些入門套件包含了能協助你快速開始的 UI Scaffolding。若你想要直接與 Laravel 的驗證系統整合,請參考 [手動驗證使用者](#authenticating-users) 內的說明文件。" +#: docs/8.x/authentication.md:block 52 (header) +msgid "Install A Starter Kit" +msgstr "安裝一種入門套件" + #: docs/8.x/authentication.md:block 54 (paragraph) msgid "Laravel Breeze is a minimal, simple implementation of all of Laravel's authentication features, including login, registration, password reset, email verification, and password confirmation. Laravel Breeze's view layer is made up of simple [Blade templates](/docs/{{version}}/blade) styled with [Tailwind CSS](https://tailwindcss.com). Breeze also offers an [Inertia](https://inertiajs.com) based scaffolding option using Vue or React." msgstr "Laravel Breeze 是一個簡單且最小化實作出所有 Laravel 認證功能的套件,包含登入、註冊、密碼重設、電子郵件認證、以及密碼確認。Laravel Breeze 的檢視器層是通過簡單的 [Blade 樣板](/docs/{{version}}/blade) 搭配 [Tailwind CSS](https://tailwindcss.com) 提供樣式組合而成的。Breeze 也提供了一個使用 Vue 或 React 的基於 [Inertia](https://inertiajs.com) 的 Scaffolding 選項。" @@ -1419,6 +1654,10 @@ msgstr "Laravel Breeze 是一個簡單且最小化實作出所有 Laravel 認證 msgid "[Laravel Jetstream](https://jetstream.laravel.com) is a more robust application starter kit that includes support for scaffolding your application with [Livewire](https://laravel-livewire.com) or [Inertia.js and Vue](https://inertiajs.com). In addition, Jetstream features optional support for two-factor authentication, teams, profile management, browser session management, API support via [Laravel Sanctum](/docs/{{version}}/sanctum), account deletion, and more." msgstr "[Laravel Jetstream](https://jetstream.laravel.com) 是一個更複雜的專案入門套件,其中包含了使用 [Livewire](https://laravel-livewire.com) 或 [Inertia.js 與 Vue](https://inertiajs.com) 來對應用程式 Scaffolding 的支援。此外,Jetstream 也提供了對二步驟認證、團隊、個人檔案管理、瀏覽器啟程管理、通過 [Laravel Sanctum](/docs/{{version}}/sanctum) 提供的 API 支援、帳號刪除…等功能的可選支援。" +#: docs/8.x/authentication.md:block 57 (header) +msgid "Retrieving The Authenticated User" +msgstr "取得已登入的使用者" + #: docs/8.x/authentication.md:block 61 (code) msgid " [\n" msgid "{tip} The following documentation discusses how to integrate with Laravel's password confirmation features directly; however, if you would like to get started more quickly, the [Laravel application starter kits](/docs/{{version}}/starter-kits) include support for this feature!" msgstr "{tip} 下列說明文件討論了如何直接整合 Laravel 的密碼確認功能。但若想更快速地入門, [Laravel 專案入門套件](/docs/{{version}}/starter-kits) 有內建支援這個功能!" +#: docs/8.x/authentication.md:block 170 (header) +msgid "Confirming The Password" +msgstr "確認密碼" + #: docs/8.x/authentication.md:block 181 (code) msgid " $email,\n" @@ -1877,6 +2168,10 @@ msgstr "if (Auth::attemptWhen([\n" msgid "Before getting started, you should make sure that the `Illuminate\\Session\\Middleware\\AuthenticateSession` middleware is included on the routes that should receive session authentication. Typically, you should place this middleware on a route group definition so that it can be applied to the majority of your application's routes. By default, the `AuthenticateSession` middleware may be attached to a route using the `auth.session` route middleware key as defined in your application's HTTP kernel:" msgstr "在開始之前,請先確保要收到 Session 身份驗證的 Route 都有包含 `Illuminate\\Session\\Middleware\\AuthenticateSession` Middleware。一般來說,應在 Route 群組定義內放入這個 Middleware,好讓該 Middleware 被套用到專案中大多數的 Route。預設情況下,`AuthenticateSession` Middleware 可使用專案 HTTP Kernel 中所定義的 `auth.session` 這個 Route Middleware 索引鍵來附加到 Route 上:" +#: docs/9.x/authentication.md:block 164 (quote) +msgid "**Note** The following documentation discusses how to integrate with Laravel's password confirmation features directly; however, if you would like to get started more quickly, the [Laravel application starter kits](/docs/{{version}}/starter-kits) include support for this feature!" +msgstr "**Note** 下列說明文件討論了如何直接整合 Laravel 的密碼確認功能。但若想更快速地入門, [Laravel 專案入門套件](/docs/{{version}}/starter-kits) 有內建支援這個功能!" + #: docs/9.x/authentication.md:block 194 (code) msgid "use App\\Models\\User;\n" "use Illuminate\\Http\\Request;\n" @@ -1917,147 +2212,3 @@ msgstr "Route::middleware('auth:api')->group(function () {\n" " // ...\n" "}\n" -#: docs/master/authentication.md:block 61 (code) -msgid "user()\n\n" -" return response()->noContent();\n" -" }\n" -"}\n" -msgstr "user()\n\n" -" return response()->noContent();\n" -" }\n" -"}\n" - -#: docs/master/authentication.md:block 187 (code) -msgid "registerPolicies();\n\n" -" Auth::extend('jwt', function (Application $app, string $name, array $config) {\n" -" // Return an instance of Illuminate\\Contracts\\Auth\\Guard...\n\n" -" return new JwtGuard(Auth::createUserProvider($config['provider']));\n" -" });\n" -" }\n" -"}\n" -msgstr "registerPolicies();\n\n" -" Auth::extend('jwt', function (Application $app, string $name, array $config) {\n" -" // 回傳 Illuminate\\Contracts\\Auth\\Guard 實體...\n\n" -" return new JwtGuard(Auth::createUserProvider($config['provider']));\n" -" });\n" -" }\n" -"}\n" - -#: docs/master/authentication.md:block 194 (code) -msgid "use App\\Models\\User;\n" -"use Illuminate\\Http\\Request;\n" -"use Illuminate\\Support\\Facades\\Auth;\n\n" -"/**\n" -" * Register any application authentication / authorization services.\n" -" */\n" -"public function boot(): void\n" -"{\n" -" $this->registerPolicies();\n\n" -" Auth::viaRequest('custom-token', function (Request $request) {\n" -" return User::where('token', $request->token)->first();\n" -" });\n" -"}\n" -msgstr "use App\\Models\\User;\n" -"use Illuminate\\Http\\Request;\n" -"use Illuminate\\Support\\Facades\\Auth;\n\n" -"/**\n" -" * Register any application authentication / authorization services.\n" -" */\n" -"public function boot(): void\n" -"{\n" -" $this->registerPolicies();\n\n" -" Auth::viaRequest('custom-token', function (Request $request) {\n" -" return User::where('token', $request->token)->first();\n" -" });\n" -"}\n" - -#: docs/master/authentication.md:block 202 (code) -msgid "registerPolicies();\n\n" -" Auth::provider('mongo', function (Application $app, array $config) {\n" -" // Return an instance of Illuminate\\Contracts\\Auth\\UserProvider...\n\n" -" return new MongoUserProvider($app->make('mongo.connection'));\n" -" });\n" -" }\n" -"}\n" -msgstr "registerPolicies();\n\n" -" Auth::provider('mongo', function (Application $app, array $config) {\n" -" // Return an instance of Illuminate\\Contracts\\Auth\\UserProvider...\n\n" -" return new MongoUserProvider($app->make('mongo.connection'));\n" -" });\n" -" }\n" -"}\n" - From eab3c8aba078a5ca3a52b783ff1abc29b277d489 Mon Sep 17 00:00:00 2001 From: Cornch Date: Sun, 30 Jun 2024 17:00:30 +0800 Subject: [PATCH 003/491] New translations authorization.pot (Chinese Traditional) --- po/zh_TW/authorization.po | 649 ++++++++++++++------------------------ 1 file changed, 244 insertions(+), 405 deletions(-) diff --git a/po/zh_TW/authorization.po b/po/zh_TW/authorization.po index b2fb6c617..74b42c7cb 100644 --- a/po/zh_TW/authorization.po +++ b/po/zh_TW/authorization.po @@ -10,7 +10,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Language-Team: Chinese Traditional\n" "Language: zh_TW\n" -"PO-Revision-Date: 2024-06-30 08:17\n" +"PO-Revision-Date: 2024-06-30 09:00\n" #: docs/10.x/authorization.md:block 1 (header) msgid "Authorization" @@ -85,8 +85,8 @@ msgid "[Authorizing Actions Using Policies](#authorizing-actions-using-policies) msgstr "[通過 Policy 來授權動作](#authorizing-actions-using-policies)" #: docs/10.x/authorization.md:block 2 (unordered list) -msgid "[Via The User Model](#via-the-user-model)" -msgstr "[通過使用者 Model](#via-the-user-model)" +msgid "[Via the User Model](#via-the-user-model)" +msgstr "" #: docs/10.x/authorization.md:block 2 (unordered list) msgid "[Via Controller Helpers](#via-controller-helpers)" @@ -129,8 +129,8 @@ msgid "Writing Gates" msgstr "撰寫 Gate" #: docs/10.x/authorization.md:block 12 (quote) -msgid "**Warning** Gates are a great way to learn the basics of Laravel's authorization features; however, when building robust Laravel applications you should consider using [policies](#creating-policies) to organize your authorization rules." -msgstr "**Warning** Gate 是學習基礎 Laravel 授權功能的最好的方法。但是,在製作大型 Laravel 應用程式時,應考慮通過 [Policy](#creating-policies) 來整理各個授權規則。" +msgid "[!WARNING] Gates are a great way to learn the basics of Laravel's authorization features; however, when building robust Laravel applications you should consider using [policies](#creating-policies) to organize your authorization rules." +msgstr "" #: docs/10.x/authorization.md:block 13 (paragraph) msgid "Gates are simply closures that determine if a user is authorized to perform a given action. Typically, gates are defined within the `boot` method of the `App\\Providers\\AuthServiceProvider` class using the `Gate` facade. Gates always receive a user instance as their first argument and may optionally receive additional arguments such as a relevant Eloquent model." @@ -279,8 +279,8 @@ msgstr "if (Gate::any(['update-post', 'delete-post'], $post)) {\n" "}\n" #: docs/10.x/authorization.md:block 27 (header) -msgid "Authorizing Or Throwing Exceptions" -msgstr "授權或擲回例外" +msgid "Authorizing or Throwing Exceptions" +msgstr "" #: docs/10.x/authorization.md:block 28 (paragraph) msgid "If you would like to attempt to authorize an action and automatically throw an `Illuminate\\Auth\\Access\\AuthorizationException` if the user is not allowed to perform the given action, you may use the `Gate` facade's `authorize` method. Instances of `AuthorizationException` are automatically converted to a 403 HTTP response by Laravel's exception handler:" @@ -487,8 +487,8 @@ msgid "Inline Authorization" msgstr "內嵌授權" #: docs/10.x/authorization.md:block 58 (paragraph) -msgid "Occasionally, you may wish to determine if the currently authenticated user is authorized to perform a given action without writing a dedicated gate that corresponds to the action. Laravel allows you to perform these types of \"inline\" authorization checks via the `Gate::allowIf` and `Gate::denyIf` methods:" -msgstr "有時候,我們可能需要判斷目前登入的使用者是否有權限進行給定動作,但我們不想給這個動作撰寫獨立的 Gate。在 Laravel,我們可以使用 `Gate::allowIf` 與 `Gate::denyIf` 方法來進行這類的「內嵌」授權檢查:" +msgid "Occasionally, you may wish to determine if the currently authenticated user is authorized to perform a given action without writing a dedicated gate that corresponds to the action. Laravel allows you to perform these types of \"inline\" authorization checks via the `Gate::allowIf` and `Gate::denyIf` methods. Inline authorization does not execute any defined [\"before\" or \"after\" authorization hooks](#intercepting-gate-checks):" +msgstr "" #: docs/10.x/authorization.md:block 59 (code) msgid "use App\\Models\\User;\n" @@ -617,8 +617,8 @@ msgstr "use Illuminate\\Support\\Facades\\Gate;\n\n" "});\n" #: docs/10.x/authorization.md:block 80 (quote) -msgid "**Warning** Any policies that are explicitly mapped in your `AuthServiceProvider` will take precedence over any potentially auto-discovered policies." -msgstr "**Warning** 所有在 `AuthServiceProvider` 中顯式映射之 Policy 的優先級都會比 Auto-Discover 的 Policy 高。" +msgid "[!WARNING] Any policies that are explicitly mapped in your `AuthServiceProvider` will take precedence over any potentially auto-discovered policies." +msgstr "" #: docs/10.x/authorization.md:block 82 (header) msgid "Writing Policies" @@ -675,8 +675,8 @@ msgid "If you used the `--model` option when generating your policy via the Arti msgstr "通過 Artisan 主控台產生 Policy 時若有使用 `--model` 選項,則 Policy 就已經包含了 `viewAny`, `view`, `create`, `update`, `delete`, `restore` 與 `forceDelete` 動作的方法。" #: docs/10.x/authorization.md:block 90 (quote) -msgid "**Note** All policies are resolved via the Laravel [service container](/docs/{{version}}/container), allowing you to type-hint any needed dependencies in the policy's constructor to have them automatically injected." -msgstr "**Note** 所有的 Policy 都經由 Laravel 的 [Service Container](/docs/{{version}}/container) 進行解析,這樣一來,可以在 Policy 的建構函式 (Constructor) 內對任何所需的相依項進行型別提示,這些相依項會被自動插入到 Class 內。" +msgid "[!NOTE] All policies are resolved via the Laravel [service container](/docs/{{version}}/container), allowing you to type-hint any needed dependencies in the policy's constructor to have them automatically injected." +msgstr "" #: docs/10.x/authorization.md:block 92 (header) msgid "Policy Responses" @@ -738,6 +738,10 @@ msgid "Gate::authorize('update', $post);\n\n" msgstr "Gate::authorize('update', $post);\n\n" "// The action is authorized...\n" +#: docs/10.x/authorization.md:block 100 (header) +msgid "Customizing the HTTP Response Status" +msgstr "" + #: docs/10.x/authorization.md:block 101 (paragraph) msgid "When an action is denied via a policy method, a `403` HTTP response is returned; however, it can sometimes be useful to return an alternative HTTP status code. You may customize the HTTP status code returned for a failed authorization check using the `denyWithStatus` static constructor on the `Illuminate\\Auth\\Access\\Response` class:" msgstr "當 Policy 方法拒絕某個動作時,會回傳 `403` HTTP Response。不過,在某些情況下,若能回傳其他的 HTTP 狀態碼更好。我們可以使用 `Illuminate\\Auth\\Access\\Response` 類別的 `denyWithStatus` 靜態建構函式來自訂在授權檢查失敗的時候要回傳的 HTTP 狀態碼:" @@ -893,16 +897,16 @@ msgid "If you would like to deny all authorization checks for a particular type msgstr "若拒絕特定類型的使用者的所有授權,可以在 `before` 方法內回傳 `false`。若回傳 `null`,則權限檢查會繼續傳到 Policy 方法內。" #: docs/10.x/authorization.md:block 118 (quote) -msgid "**Warning** The `before` method of a policy class will not be called if the class doesn't contain a method with a name matching the name of the ability being checked." -msgstr "**Warning** 若 Policy 類別內不含要檢查權限名稱的方法,則 `before` 方法將不會被呼叫。" +msgid "[!WARNING] The `before` method of a policy class will not be called if the class doesn't contain a method with a name matching the name of the ability being checked." +msgstr "" #: docs/10.x/authorization.md:block 120 (header) msgid "Authorizing Actions Using Policies" msgstr "通過 Policy 來授權動作" #: docs/10.x/authorization.md:block 122 (header) -msgid "Via The User Model" -msgstr "通過 User Model" +msgid "Via the User Model" +msgstr "" #: docs/10.x/authorization.md:block 123 (paragraph) msgid "The `App\\Models\\User` model that is included with your Laravel application includes two helpful methods for authorizing actions: `can` and `cannot`. The `can` and `cannot` methods receive the name of the action you wish to authorize and the relevant model. For example, let's determine if a user is authorized to update a given `App\\Models\\Post` model. Typically, this will be done within a controller method:" @@ -1187,8 +1191,8 @@ msgid "delete" msgstr "delete" #: docs/10.x/authorization.md:block 148 (quote) -msgid "**Note** You may use the `make:policy` command with the `--model` option to quickly generate a policy class for a given model: `php artisan make:policy PostPolicy --model=Post`." -msgstr "**Note** 可以使用 `--model` 選項搭配 `make:policy` 指令來快速為給定的 Model 產生 Policy:`php artisan make:policy PostPolicy --model=Post`。" +msgid "[!NOTE] You may use the `make:policy` command with the `--model` option to quickly generate a policy class for a given model: `php artisan make:policy PostPolicy --model=Post`." +msgstr "" #: docs/10.x/authorization.md:block 150 (header) msgid "Via Middleware" @@ -1388,6 +1392,197 @@ msgstr "/**\n" " return redirect('/posts');\n" "}\n" +#: docs/11.x/authorization.md:block 2 (unordered list) +msgid "[Via the Gate Facade](#via-the-gate-facade)" +msgstr "" + +#: docs/11.x/authorization.md:block 2 (unordered list) +msgid "[Authorization & Inertia](#authorization-and-inertia)" +msgstr "" + +#: docs/11.x/authorization.md:block 13 (paragraph) +msgid "Gates are simply closures that determine if a user is authorized to perform a given action. Typically, gates are defined within the `boot` method of the `App\\Providers\\AppServiceProvider` class using the `Gate` facade. Gates always receive a user instance as their first argument and may optionally receive additional arguments such as a relevant Eloquent model." +msgstr "" + +#: docs/11.x/authorization.md:block 15 (code) +msgid "use App\\Models\\Post;\n" +"use App\\Models\\User;\n" +"use Illuminate\\Support\\Facades\\Gate;\n\n" +"/**\n" +" * Bootstrap any application services.\n" +" */\n" +"public function boot(): void\n" +"{\n" +" Gate::define('update-post', function (User $user, Post $post) {\n" +" return $user->id === $post->user_id;\n" +" });\n" +"}\n" +msgstr "" + +#: docs/11.x/authorization.md:block 17 (code) +msgid "use App\\Policies\\PostPolicy;\n" +"use Illuminate\\Support\\Facades\\Gate;\n\n" +"/**\n" +" * Bootstrap any application services.\n" +" */\n" +"public function boot(): void\n" +"{\n" +" Gate::define('update-post', [PostPolicy::class, 'update']);\n" +"}\n" +msgstr "" + +#: docs/11.x/authorization.md:block 28 (paragraph) +msgid "If you would like to attempt to authorize an action and automatically throw an `Illuminate\\Auth\\Access\\AuthorizationException` if the user is not allowed to perform the given action, you may use the `Gate` facade's `authorize` method. Instances of `AuthorizationException` are automatically converted to a 403 HTTP response by Laravel:" +msgstr "" + +#: docs/11.x/authorization.md:block 73 (header) +msgid "Policy Discovery" +msgstr "" + +#: docs/11.x/authorization.md:block 74 (paragraph) +msgid "By default, Laravel automatically discover policies as long as the model and policy follow standard Laravel naming conventions. Specifically, the policies must be in a `Policies` directory at or above the directory that contains your models. So, for example, the models may be placed in the `app/Models` directory while the policies may be placed in the `app/Policies` directory. In this situation, Laravel will check for policies in `app/Models/Policies` then `app/Policies`. In addition, the policy name must match the model name and have a `Policy` suffix. So, a `User` model would correspond to a `UserPolicy` policy class." +msgstr "" + +#: docs/11.x/authorization.md:block 75 (paragraph) +msgid "If you would like to define your own policy discovery logic, you may register a custom policy discovery callback using the `Gate::guessPolicyNamesUsing` method. Typically, this method should be called from the `boot` method of your application's `AppServiceProvider`:" +msgstr "" + +#: docs/11.x/authorization.md:block 78 (header) +msgid "Manually Registering Policies" +msgstr "" + +#: docs/11.x/authorization.md:block 79 (paragraph) +msgid "Using the `Gate` facade, you may manually register policies and their corresponding models within the `boot` method of your application's `AppServiceProvider`:" +msgstr "" + +#: docs/11.x/authorization.md:block 80 (code) +msgid "use App\\Models\\Order;\n" +"use App\\Policies\\OrderPolicy;\n" +"use Illuminate\\Support\\Facades\\Gate;\n\n" +"/**\n" +" * Bootstrap any application services.\n" +" */\n" +"public function boot(): void\n" +"{\n" +" Gate::policy(Order::class, OrderPolicy::class);\n" +"}\n" +msgstr "" + +#: docs/11.x/authorization.md:block 131 (header) +msgid "Via the `Gate` Facade" +msgstr "" + +#: docs/11.x/authorization.md:block 132 (paragraph) +msgid "In addition to helpful methods provided to the `App\\Models\\User` model, you can always authorize actions via the `Gate` facade's `authorize` method." +msgstr "" + +#: docs/11.x/authorization.md:block 134 (code) +msgid "category]);\n\n" +" // The current user can update the blog post...\n\n" +" return redirect('/posts');\n" +"}\n" +msgstr "" + +#: docs/11.x/authorization.md:block 171 (header) +msgid "Authorization & Inertia" +msgstr "" + +#: docs/11.x/authorization.md:block 172 (paragraph) +msgid "Although authorization must always be handled on the server, it can often be convenient to provide your frontend application with authorization data in order to properly render your application's UI. Laravel does not define a required convention for exposing authorization information to an Inertia powered frontend." +msgstr "" + +#: docs/11.x/authorization.md:block 173 (paragraph) +msgid "However, if you are using one of Laravel's Inertia-based [starter kits](/docs/{{version}}/starter-kits), your application already contains a `HandleInertiaRequests` middleware. Within this middleware's `share` method, you may return shared data that will be provided to all Inertia pages in your application. This shared data can serve as a convenient location to define authorization information for the user:" +msgstr "" + +#: docs/11.x/authorization.md:block 174 (code) +msgid "\n" +" */\n" +" public function share(Request $request)\n" +" {\n" +" return [\n" +" ...parent::share($request),\n" +" 'auth' => [\n" +" 'user' => $request->user(),\n" +" 'permissions' => [\n" +" 'post' => [\n" +" 'create' => $request->user()->can('create', Post::class),\n" +" ],\n" +" ],\n" +" ],\n" +" ];\n" +" }\n" +"}\n" +msgstr "" + +#: docs/8.x/authorization.md:block 2 (unordered list) +msgid "[Via The User Model](#via-the-user-model)" +msgstr "[通過使用者 Model](#via-the-user-model)" + #: docs/8.x/authorization.md:block 7 (paragraph) msgid "You do not need to choose between exclusively using gates or exclusively using policies when building an application. Most applications will most likely contain some mixture of gates and policies, and that is perfectly fine! Gates are most applicable to actions which are not related to any model or resource, such as viewing an administrator dashboard. In contrast, policies should be used when you wish to authorize an action for a particular model or resource." msgstr "在製作網站時,不需要在 Gate 或 Policy 間二選一。大多數的專案都在某種程度上組合使用 Gate 與 Policy,混著用完全沒問題!Gate 最適合用來處理與 Model 或資源無關的動作,如檢視後台的「縱覽」頁。相較之下,Policy 則應使用於想授權對特定 Model 或 Resource 的動作時。" @@ -1502,6 +1697,10 @@ msgstr " $user->isAdministrator());\n\n" @@ -1810,6 +2013,10 @@ msgstr "use App\\Models\\User;\n\n" msgid "{note} The `before` method of a policy class will not be called if the class doesn't contain a method with a name matching the name of the ability being checked." msgstr "{note} 若 Policy 類別內不含要檢查權限名稱的方法,則 `before` 方法將不會被呼叫。" +#: docs/8.x/authorization.md:block 110 (header) +msgid "Via The User Model" +msgstr "通過 User Model" + #: docs/8.x/authorization.md:block 112 (code) msgid " $user->isAdministrator());\n\n" @@ -2088,6 +2299,14 @@ msgstr "use Illuminate\\Support\\Facades\\Gate;\n\n" "Gate::allowIf(fn ($user) => $user->isAdministrator());\n\n" "Gate::denyIf(fn ($user) => $user->banned());\n" +#: docs/9.x/authorization.md:block 80 (quote) +msgid "**Warning** Any policies that are explicitly mapped in your `AuthServiceProvider` will take precedence over any potentially auto-discovered policies." +msgstr "**Warning** 所有在 `AuthServiceProvider` 中顯式映射之 Policy 的優先級都會比 Auto-Discover 的 Policy 高。" + +#: docs/9.x/authorization.md:block 90 (quote) +msgid "**Note** All policies are resolved via the Laravel [service container](/docs/{{version}}/container), allowing you to type-hint any needed dependencies in the policy's constructor to have them automatically injected." +msgstr "**Note** 所有的 Policy 都經由 Laravel 的 [Service Container](/docs/{{version}}/container) 進行解析,這樣一來,可以在 Policy 的建構函式 (Constructor) 內對任何所需的相依項進行型別提示,這些相依項會被自動插入到 Class 內。" + #: docs/9.x/authorization.md:block 102 (code) msgid "use App\\Models\\Post;\n" "use App\\Models\\User;\n" @@ -2156,391 +2375,11 @@ msgstr "use App\\Models\\Post;\n" " : Response::denyAsNotFound();\n" "}\n" -#: docs/master/authorization.md:block 15 (code) -msgid "use App\\Models\\Post;\n" -"use App\\Models\\User;\n" -"use Illuminate\\Support\\Facades\\Gate;\n\n" -"/**\n" -" * Register any authentication / authorization services.\n" -" */\n" -"public function boot(): void\n" -"{\n" -" $this->registerPolicies();\n\n" -" Gate::define('update-post', function (User $user, Post $post) {\n" -" return $user->id === $post->user_id;\n" -" });\n" -"}\n" -msgstr "use App\\Models\\Post;\n" -"use App\\Models\\User;\n" -"use Illuminate\\Support\\Facades\\Gate;\n\n" -"/**\n" -" * Register any authentication / authorization services.\n" -" */\n" -"public function boot(): void\n" -"{\n" -" $this->registerPolicies();\n\n" -" Gate::define('update-post', function (User $user, Post $post) {\n" -" return $user->id === $post->user_id;\n" -" });\n" -"}\n" - -#: docs/master/authorization.md:block 17 (code) -msgid "use App\\Policies\\PostPolicy;\n" -"use Illuminate\\Support\\Facades\\Gate;\n\n" -"/**\n" -" * Register any authentication / authorization services.\n" -" */\n" -"public function boot(): void\n" -"{\n" -" $this->registerPolicies();\n\n" -" Gate::define('update-post', [PostPolicy::class, 'update']);\n" -"}\n" -msgstr "use App\\Policies\\PostPolicy;\n" -"use Illuminate\\Support\\Facades\\Gate;\n\n" -"/**\n" -" * Register any authentication / authorization services.\n" -" */\n" -"public function boot(): void\n" -"{\n" -" $this->registerPolicies();\n\n" -" Gate::define('update-post', [PostPolicy::class, 'update']);\n" -"}\n" +#: docs/9.x/authorization.md:block 118 (quote) +msgid "**Warning** The `before` method of a policy class will not be called if the class doesn't contain a method with a name matching the name of the ability being checked." +msgstr "**Warning** 若 Policy 類別內不含要檢查權限名稱的方法,則 `before` 方法將不會被呼叫。" -#: docs/master/authorization.md:block 21 (code) -msgid "noContent();\n" -" }\n" -"}\n" -msgstr "noContent();\n" -" }\n" -"}\n" - -#: docs/master/authorization.md:block 74 (code) -msgid " PostPolicy::class,\n" -" ];\n\n" -" /**\n" -" * Register any application authentication / authorization services.\n" -" */\n" -" public function boot(): void\n" -" {\n" -" $this->registerPolicies();\n\n" -" // ...\n" -" }\n" -"}\n" -msgstr " PostPolicy::class,\n" -" ];\n\n" -" /**\n" -" * Register any application authentication / authorization services.\n" -" */\n" -" public function boot(): void\n" -" {\n" -" $this->registerPolicies();\n\n" -" // ...\n" -" }\n" -"}\n" - -#: docs/master/authorization.md:block 112 (code) -msgid "id === $post->user_id;\n" -" }\n" -"}\n" -msgstr "id === $post->user_id;\n" -" }\n" -"}\n" - -#: docs/master/authorization.md:block 124 (code) -msgid "user()->cannot('update', $post)) {\n" -" abort(403);\n" -" }\n\n" -" // Update the post...\n\n" -" return response()->noContent();\n" -" }\n" -"}\n" -msgstr "user()->cannot('update', $post)) {\n" -" abort(403);\n" -" }\n\n" -" // 更新貼文...\n\n" -" return response()->noContent();\n" -" }\n" -"}\n" - -#: docs/master/authorization.md:block 129 (code) -msgid "user()->cannot('create', Post::class)) {\n" -" abort(403);\n" -" }\n\n" -" // Create the post...\n\n" -" return response()->noContent();\n" -" }\n" -"}\n" -msgstr "user()->cannot('create', Post::class)) {\n" -" abort(403);\n" -" }\n\n" -" // 建立貼文...\n\n" -" return response()->noContent();\n" -" }\n" -"}\n" - -#: docs/master/authorization.md:block 134 (code) -msgid "authorize('update', $post);\n\n" -" // The current user can update the blog post...\n\n" -" return response()->noContent();\n" -" }\n" -"}\n" -msgstr "authorize('update', $post);\n\n" -" // 目前使用者可更新此部落格貼文...\n\n" -" return response()->noContent();\n" -" }\n" -"}\n" - -#: docs/master/authorization.md:block 138 (code) -msgid "use App\\Models\\Post;\n" -"use Illuminate\\Http\\Request;\n" -"use Illuminate\\Http\\Response;\n\n" -"/**\n" -" * Create a new blog post.\n" -" *\n" -" * @throws \\Illuminate\\Auth\\Access\\AuthorizationException\n" -" */\n" -"public function create(Request $request): Response\n" -"{\n" -" $this->authorize('create', Post::class);\n\n" -" // The current user can create blog posts...\n\n" -" return response()->noContent();\n" -"}\n" -msgstr "use App\\Models\\Post;\n" -"use Illuminate\\Http\\Request;\n" -"use Illuminate\\Http\\Response;\n\n" -"/**\n" -" * Create a new blog post.\n" -" *\n" -" * @throws \\Illuminate\\Auth\\Access\\AuthorizationException\n" -" */\n" -"public function create(Request $request): Response\n" -"{\n" -" $this->authorize('create', Post::class);\n\n" -" // 目前使用者可建立部落格貼文...\n\n" -" return response()->noContent();\n" -"}\n" - -#: docs/master/authorization.md:block 143 (code) -msgid "authorizeResource(Post::class, 'post');\n" -" }\n" -"}\n" -msgstr "authorizeResource(Post::class, 'post');\n" -" }\n" -"}\n" - -#: docs/master/authorization.md:block 179 (code) -msgid "/**\n" -" * Update the given blog post.\n" -" *\n" -" * @throws \\Illuminate\\Auth\\Access\\AuthorizationException\n" -" */\n" -"public function update(Request $request, Post $post): Response\n" -"{\n" -" $this->authorize('update', [$post, $request->category]);\n\n" -" // The current user can update the blog post...\n\n" -" return response()->noContent();\n" -"}\n" -msgstr "/**\n" -" * Update the given blog post.\n" -" *\n" -" * @throws \\Illuminate\\Auth\\Access\\AuthorizationException\n" -" */\n" -"public function update(Request $request, Post $post): Response\n" -"{\n" -" $this->authorize('update', [$post, $request->category]);\n\n" -" // 目前使用者可更新部落格貼文...\n\n" -" return response()->noContent();\n" -"}\n" +#: docs/9.x/authorization.md:block 146 (quote) +msgid "**Note** You may use the `make:policy` command with the `--model` option to quickly generate a policy class for a given model: `php artisan make:policy PostPolicy --model=Post`." +msgstr "**Note** 可以使用 `--model` 選項搭配 `make:policy` 指令來快速為給定的 Model 產生 Policy:`php artisan make:policy PostPolicy --model=Post`。" From bc73ffebafc49407b40a9790ed569128a14983d1 Mon Sep 17 00:00:00 2001 From: Cornch Date: Sun, 30 Jun 2024 17:00:31 +0800 Subject: [PATCH 004/491] New translations billing.pot (Chinese Traditional) --- po/zh_TW/billing.po | 1843 ++++++++++++++++++++++++++++--------------- 1 file changed, 1185 insertions(+), 658 deletions(-) diff --git a/po/zh_TW/billing.po b/po/zh_TW/billing.po index e314ddfb0..b80772c5b 100644 --- a/po/zh_TW/billing.po +++ b/po/zh_TW/billing.po @@ -10,7 +10,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Language-Team: Chinese Traditional\n" "Language: zh_TW\n" -"PO-Revision-Date: 2024-06-30 08:17\n" +"PO-Revision-Date: 2024-06-30 09:00\n" #: docs/10.x/billing.md:block 1 (header) msgid "Laravel Cashier (Stripe)" @@ -28,10 +28,6 @@ msgstr "" msgid "[Installation](#installation)" msgstr "" -#: docs/10.x/billing.md:block 2 (unordered list) -msgid "[Database Migrations](#database-migrations)" -msgstr "" - #: docs/10.x/billing.md:block 2 (unordered list) msgid "[Configuration](#configuration)" msgstr "" @@ -60,6 +56,18 @@ msgstr "" msgid "[Using Custom Models](#using-custom-models)" msgstr "" +#: docs/10.x/billing.md:block 2 (unordered list) +msgid "[Quickstart](#quickstart)" +msgstr "" + +#: docs/10.x/billing.md:block 2 (unordered list) +msgid "[Selling Products](#quickstart-selling-products)" +msgstr "" + +#: docs/10.x/billing.md:block 2 (unordered list) +msgid "[Selling Subscriptions](#quickstart-selling-subscriptions)" +msgstr "" + #: docs/10.x/billing.md:block 2 (unordered list) msgid "[Customers](#customers)" msgstr "" @@ -105,11 +113,11 @@ msgid "[Retrieving Payment Methods](#retrieving-payment-methods)" msgstr "" #: docs/10.x/billing.md:block 2 (unordered list) -msgid "[Determining If A User Has A Payment Method](#check-for-a-payment-method)" +msgid "[Payment Method Presence](#payment-method-presence)" msgstr "" #: docs/10.x/billing.md:block 2 (unordered list) -msgid "[Updating The Default Payment Method](#updating-the-default-payment-method)" +msgid "[Updating the Default Payment Method](#updating-the-default-payment-method)" msgstr "" #: docs/10.x/billing.md:block 2 (unordered list) @@ -305,7 +313,7 @@ msgid "When upgrading to a new version of Cashier, it's important that you caref msgstr "" #: docs/10.x/billing.md:block 9 (quote) -msgid "**Warning** To prevent breaking changes, Cashier uses a fixed Stripe API version. Cashier 14 utilizes Stripe API version `2022-11-15`. The Stripe API version will be updated on minor releases in order to make use of new Stripe features and improvements." +msgid "[!WARNING] To prevent breaking changes, Cashier uses a fixed Stripe API version. Cashier 15 utilizes Stripe API version `2023-10-16`. The Stripe API version will be updated on minor releases in order to make use of new Stripe features and improvements." msgstr "" #: docs/10.x/billing.md:block 11 (header) @@ -320,62 +328,55 @@ msgstr "" msgid "composer require laravel/cashier\n" msgstr "" -#: docs/10.x/billing.md:block 14 (quote) -msgid "**Warning** To ensure Cashier properly handles all Stripe events, remember to [set up Cashier's webhook handling](#handling-stripe-webhooks)." +#: docs/10.x/billing.md:block 14 (paragraph) +msgid "After installing the package, publish Cashier's migrations using the `vendor:publish` Artisan command:" msgstr "" -#: docs/10.x/billing.md:block 16 (header) -msgid "Database Migrations" +#: docs/10.x/billing.md:block 15 (code) +msgid "php artisan vendor:publish --tag=\"cashier-migrations\"\n" msgstr "" -#: docs/10.x/billing.md:block 17 (paragraph) -msgid "Cashier's service provider registers its own database migration directory, so remember to migrate your database after installing the package. The Cashier migrations will add several columns to your `users` table. It will also create a new `subscriptions` table to hold all of your customer's subscriptions and a `subscription_items` table for subscriptions with multiple prices:" +#: docs/10.x/billing.md:block 16 (paragraph) +msgid "Then, migrate your database:" msgstr "" -#: docs/10.x/billing.md:block 18 (code) +#: docs/10.x/billing.md:block 17 (code) msgid "php artisan migrate\n" msgstr "" +#: docs/10.x/billing.md:block 18 (paragraph) +msgid "Cashier's migrations will add several columns to your `users` table. They will also create a new `subscriptions` table to hold all of your customer's subscriptions and a `subscription_items` table for subscriptions with multiple prices." +msgstr "" + #: docs/10.x/billing.md:block 19 (paragraph) -msgid "If you need to overwrite the migrations that ship with Cashier, you can publish them using the `vendor:publish` Artisan command:" +msgid "If you wish, you can also publish Cashier's configuration file using the `vendor:publish` Artisan command:" msgstr "" #: docs/10.x/billing.md:block 20 (code) -msgid "php artisan vendor:publish --tag=\"cashier-migrations\"\n" +msgid "php artisan vendor:publish --tag=\"cashier-config\"\n" msgstr "" #: docs/10.x/billing.md:block 21 (paragraph) -msgid "If you would like to prevent Cashier's migrations from running entirely, you may use the `ignoreMigrations` method provided by Cashier. Typically, this method should be called in the `register` method of your `AppServiceProvider`:" -msgstr "" - -#: docs/10.x/billing.md:block 22 (code) -msgid "use Laravel\\Cashier\\Cashier;\n\n" -"/**\n" -" * Register any application services.\n" -" */\n" -"public function register(): void\n" -"{\n" -" Cashier::ignoreMigrations();\n" -"}\n" +msgid "Lastly, to ensure Cashier properly handles all Stripe events, remember to [configure Cashier's webhook handling](#handling-stripe-webhooks)." msgstr "" -#: docs/10.x/billing.md:block 23 (quote) -msgid "**Warning** Stripe recommends that any column used for storing Stripe identifiers should be case-sensitive. Therefore, you should ensure the column collation for the `stripe_id` column is set to `utf8_bin` when using MySQL. More information regarding this can be found in the [Stripe documentation](https://stripe.com/docs/upgrades#what-changes-does-stripe-consider-to-be-backwards-compatible)." +#: docs/10.x/billing.md:block 22 (quote) +msgid "[!WARNING] Stripe recommends that any column used for storing Stripe identifiers should be case-sensitive. Therefore, you should ensure the column collation for the `stripe_id` column is set to `utf8_bin` when using MySQL. More information regarding this can be found in the [Stripe documentation](https://stripe.com/docs/upgrades#what-changes-does-stripe-consider-to-be-backwards-compatible)." msgstr "" -#: docs/10.x/billing.md:block 25 (header) +#: docs/10.x/billing.md:block 24 (header) msgid "Configuration" msgstr "" -#: docs/10.x/billing.md:block 27 (header) +#: docs/10.x/billing.md:block 26 (header) msgid "Billable Model" msgstr "" -#: docs/10.x/billing.md:block 28 (paragraph) +#: docs/10.x/billing.md:block 27 (paragraph) msgid "Before using Cashier, add the `Billable` trait to your billable model definition. Typically, this will be the `App\\Models\\User` model. This trait provides various methods to allow you to perform common billing tasks, such as creating subscriptions, applying coupons, and updating payment method information:" msgstr "" -#: docs/10.x/billing.md:block 29 (code) +#: docs/10.x/billing.md:block 28 (code) msgid "use Laravel\\Cashier\\Billable;\n\n" "class User extends Authenticatable\n" "{\n" @@ -383,11 +384,11 @@ msgid "use Laravel\\Cashier\\Billable;\n\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 30 (paragraph) +#: docs/10.x/billing.md:block 29 (paragraph) msgid "Cashier assumes your billable model will be the `App\\Models\\User` class that ships with Laravel. If you wish to change this you may specify a different model via the `useCustomerModel` method. This method should typically be called in the `boot` method of your `AppServiceProvider` class:" msgstr "" -#: docs/10.x/billing.md:block 31 (code) +#: docs/10.x/billing.md:block 30 (code) msgid "use App\\Models\\Cashier\\User;\n" "use Laravel\\Cashier\\Cashier;\n\n" "/**\n" @@ -399,61 +400,61 @@ msgid "use App\\Models\\Cashier\\User;\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 32 (quote) -msgid "**Warning** If you're using a model other than Laravel's supplied `App\\Models\\User` model, you'll need to publish and alter the [Cashier migrations](#installation) provided to match your alternative model's table name." +#: docs/10.x/billing.md:block 31 (quote) +msgid "[!WARNING] If you're using a model other than Laravel's supplied `App\\Models\\User` model, you'll need to publish and alter the [Cashier migrations](#installation) provided to match your alternative model's table name." msgstr "" -#: docs/10.x/billing.md:block 34 (header) +#: docs/10.x/billing.md:block 33 (header) msgid "API Keys" msgstr "" -#: docs/10.x/billing.md:block 35 (paragraph) +#: docs/10.x/billing.md:block 34 (paragraph) msgid "Next, you should configure your Stripe API keys in your application's `.env` file. You can retrieve your Stripe API keys from the Stripe control panel:" msgstr "" -#: docs/10.x/billing.md:block 36 (code) +#: docs/10.x/billing.md:block 35 (code) msgid "STRIPE_KEY=your-stripe-key\n" "STRIPE_SECRET=your-stripe-secret\n" "STRIPE_WEBHOOK_SECRET=your-stripe-webhook-secret\n" msgstr "" -#: docs/10.x/billing.md:block 37 (quote) -msgid "**Warning** You should ensure that the `STRIPE_WEBHOOK_SECRET` environment variable is defined in your application's `.env` file, as this variable is used to ensure that incoming webhooks are actually from Stripe." +#: docs/10.x/billing.md:block 36 (quote) +msgid "[!WARNING] You should ensure that the `STRIPE_WEBHOOK_SECRET` environment variable is defined in your application's `.env` file, as this variable is used to ensure that incoming webhooks are actually from Stripe." msgstr "" -#: docs/10.x/billing.md:block 39 (header) +#: docs/10.x/billing.md:block 38 (header) msgid "Currency Configuration" msgstr "" -#: docs/10.x/billing.md:block 40 (paragraph) +#: docs/10.x/billing.md:block 39 (paragraph) msgid "The default Cashier currency is United States Dollars (USD). You can change the default currency by setting the `CASHIER_CURRENCY` environment variable within your application's `.env` file:" msgstr "" -#: docs/10.x/billing.md:block 41 (code) +#: docs/10.x/billing.md:block 40 (code) msgid "CASHIER_CURRENCY=eur\n" msgstr "" -#: docs/10.x/billing.md:block 42 (paragraph) +#: docs/10.x/billing.md:block 41 (paragraph) msgid "In addition to configuring Cashier's currency, you may also specify a locale to be used when formatting money values for display on invoices. Internally, Cashier utilizes [PHP's `NumberFormatter` class](https://www.php.net/manual/en/class.numberformatter.php) to set the currency locale:" msgstr "" -#: docs/10.x/billing.md:block 43 (code) +#: docs/10.x/billing.md:block 42 (code) msgid "CASHIER_CURRENCY_LOCALE=nl_BE\n" msgstr "" -#: docs/10.x/billing.md:block 44 (quote) -msgid "**Warning** In order to use locales other than `en`, ensure the `ext-intl` PHP extension is installed and configured on your server." +#: docs/10.x/billing.md:block 43 (quote) +msgid "[!WARNING] In order to use locales other than `en`, ensure the `ext-intl` PHP extension is installed and configured on your server." msgstr "" -#: docs/10.x/billing.md:block 46 (header) +#: docs/10.x/billing.md:block 45 (header) msgid "Tax Configuration" msgstr "" -#: docs/10.x/billing.md:block 47 (paragraph) +#: docs/10.x/billing.md:block 46 (paragraph) msgid "Thanks to [Stripe Tax](https://stripe.com/tax), it's possible to automatically calculate taxes for all invoices generated by Stripe. You can enable automatic tax calculation by invoking the `calculateTaxes` method in the `boot` method of your application's `App\\Providers\\AppServiceProvider` class:" msgstr "" -#: docs/10.x/billing.md:block 48 (code) +#: docs/10.x/billing.md:block 47 (code) msgid "use Laravel\\Cashier\\Cashier;\n\n" "/**\n" " * Bootstrap any application services.\n" @@ -464,43 +465,43 @@ msgid "use Laravel\\Cashier\\Cashier;\n\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 49 (paragraph) +#: docs/10.x/billing.md:block 48 (paragraph) msgid "Once tax calculation has been enabled, any new subscriptions and any one-off invoices that are generated will receive automatic tax calculation." msgstr "" -#: docs/10.x/billing.md:block 50 (paragraph) +#: docs/10.x/billing.md:block 49 (paragraph) msgid "For this feature to work properly, your customer's billing details, such as the customer's name, address, and tax ID, need to be synced to Stripe. You may use the [customer data synchronization](#syncing-customer-data-with-stripe) and [Tax ID](#tax-ids) methods offered by Cashier to accomplish this." msgstr "" -#: docs/10.x/billing.md:block 51 (quote) -msgid "**Warning** No tax is calculated for [single charges](#single-charges) or [single charge checkouts](#single-charge-checkouts)." +#: docs/10.x/billing.md:block 50 (quote) +msgid "[!WARNING] No tax is calculated for [single charges](#single-charges) or [single charge checkouts](#single-charge-checkouts)." msgstr "" -#: docs/10.x/billing.md:block 53 (header) +#: docs/10.x/billing.md:block 52 (header) msgid "Logging" msgstr "" -#: docs/10.x/billing.md:block 54 (paragraph) +#: docs/10.x/billing.md:block 53 (paragraph) msgid "Cashier allows you to specify the log channel to be used when logging fatal Stripe errors. You may specify the log channel by defining the `CASHIER_LOGGER` environment variable within your application's `.env` file:" msgstr "" -#: docs/10.x/billing.md:block 55 (code) +#: docs/10.x/billing.md:block 54 (code) msgid "CASHIER_LOGGER=stack\n" msgstr "" -#: docs/10.x/billing.md:block 56 (paragraph) +#: docs/10.x/billing.md:block 55 (paragraph) msgid "Exceptions that are generated by API calls to Stripe will be logged through your application's default log channel." msgstr "" -#: docs/10.x/billing.md:block 58 (header) +#: docs/10.x/billing.md:block 57 (header) msgid "Using Custom Models" msgstr "" -#: docs/10.x/billing.md:block 59 (paragraph) +#: docs/10.x/billing.md:block 58 (paragraph) msgid "You are free to extend the models used internally by Cashier by defining your own model and extending the corresponding Cashier model:" msgstr "" -#: docs/10.x/billing.md:block 60 (code) +#: docs/10.x/billing.md:block 59 (code) msgid "use Laravel\\Cashier\\Subscription as CashierSubscription;\n\n" "class Subscription extends CashierSubscription\n" "{\n" @@ -508,11 +509,11 @@ msgid "use Laravel\\Cashier\\Subscription as CashierSubscription;\n\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 61 (paragraph) +#: docs/10.x/billing.md:block 60 (paragraph) msgid "After defining your model, you may instruct Cashier to use your custom model via the `Laravel\\Cashier\\Cashier` class. Typically, you should inform Cashier about your custom models in the `boot` method of your application's `App\\Providers\\AppServiceProvider` class:" msgstr "" -#: docs/10.x/billing.md:block 62 (code) +#: docs/10.x/billing.md:block 61 (code) msgid "use App\\Models\\Cashier\\Subscription;\n" "use App\\Models\\Cashier\\SubscriptionItem;\n\n" "/**\n" @@ -525,104 +526,335 @@ msgid "use App\\Models\\Cashier\\Subscription;\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 64 (header) +#: docs/10.x/billing.md:block 63 (header) +msgid "Quickstart" +msgstr "" + +#: docs/10.x/billing.md:block 65 (header) +msgid "Selling Products" +msgstr "" + +#: docs/10.x/billing.md:block 66 (quote) +msgid "[!NOTE] Before utilizing Stripe Checkout, you should define Products with fixed prices in your Stripe dashboard. In addition, you should [configure Cashier's webhook handling](#handling-stripe-webhooks)." +msgstr "" + +#: docs/10.x/billing.md:block 67 (paragraph) +msgid "Offering product and subscription billing via your application can be intimidating. However, thanks to Cashier and [Stripe Checkout](https://stripe.com/payments/checkout), you can easily build modern, robust payment integrations." +msgstr "" + +#: docs/10.x/billing.md:block 68 (paragraph) +msgid "To charge customers for non-recurring, single-charge products, we'll utilize Cashier to direct customers to Stripe Checkout, where they will provide their payment details and confirm their purchase. Once the payment has been made via Checkout, the customer will be redirected to a success URL of your choosing within your application:" +msgstr "" + +#: docs/10.x/billing.md:block 69 (code) +msgid "use Illuminate\\Http\\Request;\n\n" +"Route::get('/checkout', function (Request $request) {\n" +" $stripePriceId = 'price_deluxe_album';\n\n" +" $quantity = 1;\n\n" +" return $request->user()->checkout([$stripePriceId => $quantity], [\n" +" 'success_url' => route('checkout-success'),\n" +" 'cancel_url' => route('checkout-cancel'),\n" +" ]);\n" +"})->name('checkout');\n\n" +"Route::view('checkout.success')->name('checkout-success');\n" +"Route::view('checkout.cancel')->name('checkout-cancel');\n" +msgstr "" + +#: docs/10.x/billing.md:block 70 (paragraph) +msgid "As you can see in the example above, we will utilize Cashier's provided `checkout` method to redirect the customer to Stripe Checkout for a given \"price identifier\". When using Stripe, \"prices\" refer to [defined prices for specific products](https://stripe.com/docs/products-prices/how-products-and-prices-work)." +msgstr "" + +#: docs/10.x/billing.md:block 71 (paragraph) +msgid "If necessary, the `checkout` method will automatically create a customer in Stripe and connect that Stripe customer record to the corresponding user in your application's database. After completing the checkout session, the customer will be redirected to a dedicated success or cancellation page where you can display an informational message to the customer." +msgstr "" + +#: docs/10.x/billing.md:block 73 (header) +msgid "Providing Meta Data to Stripe Checkout" +msgstr "" + +#: docs/10.x/billing.md:block 74 (paragraph) +msgid "When selling products, it's common to keep track of completed orders and purchased products via `Cart` and `Order` models defined by your own application. When redirecting customers to Stripe Checkout to complete a purchase, you may need to provide an existing order identifier so that you can associate the completed purchase with the corresponding order when the customer is redirected back to your application." +msgstr "" + +#: docs/10.x/billing.md:block 75 (paragraph) +msgid "To accomplish this, you may provide an array of `metadata` to the `checkout` method. Let's imagine that a pending `Order` is created within our application when a user begins the checkout process. Remember, the `Cart` and `Order` models in this example are illustrative and not provided by Cashier. You are free to implement these concepts based on the needs of your own application:" +msgstr "" + +#: docs/10.x/billing.md:block 76 (code) +msgid "use App\\Models\\Cart;\n" +"use App\\Models\\Order;\n" +"use Illuminate\\Http\\Request;\n\n" +"Route::get('/cart/{cart}/checkout', function (Request $request, Cart $cart) {\n" +" $order = Order::create([\n" +" 'cart_id' => $cart->id,\n" +" 'price_ids' => $cart->price_ids,\n" +" 'status' => 'incomplete',\n" +" ]);\n\n" +" return $request->user()->checkout($order->price_ids, [\n" +" 'success_url' => route('checkout-success').'?session_id={CHECKOUT_SESSION_ID}',\n" +" 'cancel_url' => route('checkout-cancel'),\n" +" 'metadata' => ['order_id' => $order->id],\n" +" ]);\n" +"})->name('checkout');\n" +msgstr "" + +#: docs/10.x/billing.md:block 77 (paragraph) +msgid "As you can see in the example above, when a user begins the checkout process, we will provide all of the cart / order's associated Stripe price identifiers to the `checkout` method. Of course, your application is responsible for associating these items with the \"shopping cart\" or order as a customer adds them. We also provide the order's ID to the Stripe Checkout session via the `metadata` array. Finally, we have added the `CHECKOUT_SESSION_ID` template variable to the Checkout success route. When Stripe redirects customers back to your application, this template variable will automatically be populated with the Checkout session ID." +msgstr "" + +#: docs/10.x/billing.md:block 78 (paragraph) +msgid "Next, let's build the Checkout success route. This is the route that users will be redirected to after their purchase has been completed via Stripe Checkout. Within this route, we can retrieve the Stripe Checkout session ID and the associated Stripe Checkout instance in order to access our provided meta data and update our customer's order accordingly:" +msgstr "" + +#: docs/10.x/billing.md:block 79 (code) +msgid "use App\\Models\\Order;\n" +"use Illuminate\\Http\\Request;\n" +"use Laravel\\Cashier\\Cashier;\n\n" +"Route::get('/checkout/success', function (Request $request) {\n" +" $sessionId = $request->get('session_id');\n\n" +" if ($sessionId === null) {\n" +" return;\n" +" }\n\n" +" $session = Cashier::stripe()->checkout->sessions->retrieve($sessionId);\n\n" +" if ($session->payment_status !== 'paid') {\n" +" return;\n" +" }\n\n" +" $orderId = $session['metadata']['order_id'] ?? null;\n\n" +" $order = Order::findOrFail($orderId);\n\n" +" $order->update(['status' => 'completed']);\n\n" +" return view('checkout-success', ['order' => $order]);\n" +"})->name('checkout-success');\n" +msgstr "" + +#: docs/10.x/billing.md:block 80 (paragraph) +msgid "Please refer to Stripe's documentation for more information on the [data contained by the Checkout session object](https://stripe.com/docs/api/checkout/sessions/object)." +msgstr "" + +#: docs/10.x/billing.md:block 82 (header) +msgid "Selling Subscriptions" +msgstr "" + +#: docs/10.x/billing.md:block 85 (paragraph) +msgid "To learn how to sell subscriptions using Cashier and Stripe Checkout, let's consider the simple scenario of a subscription service with a basic monthly (`price_basic_monthly`) and yearly (`price_basic_yearly`) plan. These two prices could be grouped under a \"Basic\" product (`pro_basic`) in our Stripe dashboard. In addition, our subscription service might offer an Expert plan as `pro_expert`." +msgstr "" + +#: docs/10.x/billing.md:block 86 (paragraph) +msgid "First, let's discover how a customer can subscribe to our services. Of course, you can imagine the customer might click a \"subscribe\" button for the Basic plan on our application's pricing page. This button or link should direct the user to a Laravel route which creates the Stripe Checkout session for their chosen plan:" +msgstr "" + +#: docs/10.x/billing.md:block 87 (code) +msgid "use Illuminate\\Http\\Request;\n\n" +"Route::get('/subscription-checkout', function (Request $request) {\n" +" return $request->user()\n" +" ->newSubscription('default', 'price_basic_monthly')\n" +" ->trialDays(5)\n" +" ->allowPromotionCodes()\n" +" ->checkout([\n" +" 'success_url' => route('your-success-route'),\n" +" 'cancel_url' => route('your-cancel-route'),\n" +" ]);\n" +"});\n" +msgstr "" + +#: docs/10.x/billing.md:block 88 (paragraph) +msgid "As you can see in the example above, we will redirect the customer to a Stripe Checkout session which will allow them to subscribe to our Basic plan. After a successful checkout or cancellation, the customer will be redirected back to the URL we provided to the `checkout` method. To know when their subscription has actually started (since some payment methods require a few seconds to process), we'll also need to [configure Cashier's webhook handling](#handling-stripe-webhooks)." +msgstr "" + +#: docs/10.x/billing.md:block 89 (paragraph) +msgid "Now that customers can start subscriptions, we need to restrict certain portions of our application so that only subscribed users can access them. Of course, we can always determine a user's current subscription status via the `subscribed` method provided by Cashier's `Billable` trait:" +msgstr "" + +#: docs/10.x/billing.md:block 90 (code) +msgid "@if ($user->subscribed())\n" +"

You are subscribed.

\n" +"@endif\n" +msgstr "" + +#: docs/10.x/billing.md:block 91 (paragraph) +msgid "We can even easily determine if a user is subscribed to specific product or price:" +msgstr "" + +#: docs/10.x/billing.md:block 92 (code) +msgid "@if ($user->subscribedToProduct('pro_basic'))\n" +"

You are subscribed to our Basic product.

\n" +"@endif\n\n" +"@if ($user->subscribedToPrice('price_basic_monthly'))\n" +"

You are subscribed to our monthly Basic plan.

\n" +"@endif\n" +msgstr "" + +#: docs/10.x/billing.md:block 94 (header) +msgid "Building a Subscribed Middleware" +msgstr "" + +#: docs/10.x/billing.md:block 95 (paragraph) +msgid "For convenience, you may wish to create a [middleware](/docs/{{version}}/middleware) which determines if the incoming request is from a subscribed user. Once this middleware has been defined, you may easily assign it to a route to prevent users that are not subscribed from accessing the route:" +msgstr "" + +#: docs/10.x/billing.md:block 96 (code) +msgid "user()?->subscribed()) {\n" +" // Redirect user to billing page and ask them to subscribe...\n" +" return redirect('/billing');\n" +" }\n\n" +" return $next($request);\n" +" }\n" +"}\n" +msgstr "" + +#: docs/10.x/billing.md:block 97 (paragraph) +msgid "Once the middleware has been defined, you may assign it to a route:" +msgstr "" + +#: docs/10.x/billing.md:block 98 (code) +msgid "use App\\Http\\Middleware\\Subscribed;\n\n" +"Route::get('/dashboard', function () {\n" +" // ...\n" +"})->middleware([Subscribed::class]);\n" +msgstr "" + +#: docs/10.x/billing.md:block 100 (header) +msgid "Allowing Customers to Manage Their Billing Plan" +msgstr "" + +#: docs/10.x/billing.md:block 101 (paragraph) +msgid "Of course, customers may want to change their subscription plan to another product or \"tier\". The easiest way to allow this is by directing customers to Stripe's [Customer Billing Portal](https://stripe.com/docs/no-code/customer-portal), which provides a hosted user interface that allows customers to download invoices, update their payment method, and change subscription plans." +msgstr "" + +#: docs/10.x/billing.md:block 102 (paragraph) +msgid "First, define a link or button within your application that directs users to a Laravel route which we will utilize to initiate a Billing Portal session:" +msgstr "" + +#: docs/10.x/billing.md:block 103 (code) +msgid "\n" +" Billing\n" +"\n" +msgstr "" + +#: docs/10.x/billing.md:block 104 (paragraph) +msgid "Next, let's define the route that initiates a Stripe Customer Billing Portal session and redirects the user to the Portal. The `redirectToBillingPortal` method accepts the URL that users should be returned to when exiting the Portal:" +msgstr "" + +#: docs/10.x/billing.md:block 105 (code) +msgid "use Illuminate\\Http\\Request;\n\n" +"Route::get('/billing', function (Request $request) {\n" +" return $request->user()->redirectToBillingPortal(route('dashboard'));\n" +"})->middleware(['auth'])->name('billing');\n" +msgstr "" + +#: docs/10.x/billing.md:block 106 (quote) +msgid "[!NOTE] As long as you have configured Cashier's webhook handling, Cashier will automatically keep your application's Cashier-related database tables in sync by inspecting the incoming webhooks from Stripe. So, for example, when a user cancels their subscription via Stripe's Customer Billing Portal, Cashier will receive the corresponding webhook and mark the subscription as \"cancelled\" in your application's database." +msgstr "" + +#: docs/10.x/billing.md:block 108 (header) msgid "Customers" msgstr "" -#: docs/10.x/billing.md:block 66 (header) +#: docs/10.x/billing.md:block 110 (header) msgid "Retrieving Customers" msgstr "" -#: docs/10.x/billing.md:block 67 (paragraph) +#: docs/10.x/billing.md:block 111 (paragraph) msgid "You can retrieve a customer by their Stripe ID using the `Cashier::findBillable` method. This method will return an instance of the billable model:" msgstr "" -#: docs/10.x/billing.md:block 68 (code) +#: docs/10.x/billing.md:block 112 (code) msgid "use Laravel\\Cashier\\Cashier;\n\n" "$user = Cashier::findBillable($stripeId);\n" msgstr "" -#: docs/10.x/billing.md:block 70 (header) +#: docs/10.x/billing.md:block 114 (header) msgid "Creating Customers" msgstr "" -#: docs/10.x/billing.md:block 71 (paragraph) +#: docs/10.x/billing.md:block 115 (paragraph) msgid "Occasionally, you may wish to create a Stripe customer without beginning a subscription. You may accomplish this using the `createAsStripeCustomer` method:" msgstr "" -#: docs/10.x/billing.md:block 72 (code) +#: docs/10.x/billing.md:block 116 (code) msgid "$stripeCustomer = $user->createAsStripeCustomer();\n" msgstr "" -#: docs/10.x/billing.md:block 73 (paragraph) +#: docs/10.x/billing.md:block 117 (paragraph) msgid "Once the customer has been created in Stripe, you may begin a subscription at a later date. You may provide an optional `$options` array to pass in any additional [customer creation parameters that are supported by the Stripe API](https://stripe.com/docs/api/customers/create):" msgstr "" -#: docs/10.x/billing.md:block 74 (code) +#: docs/10.x/billing.md:block 118 (code) msgid "$stripeCustomer = $user->createAsStripeCustomer($options);\n" msgstr "" -#: docs/10.x/billing.md:block 75 (paragraph) +#: docs/10.x/billing.md:block 119 (paragraph) msgid "You may use the `asStripeCustomer` method if you want to return the Stripe customer object for a billable model:" msgstr "" -#: docs/10.x/billing.md:block 76 (code) +#: docs/10.x/billing.md:block 120 (code) msgid "$stripeCustomer = $user->asStripeCustomer();\n" msgstr "" -#: docs/10.x/billing.md:block 77 (paragraph) +#: docs/10.x/billing.md:block 121 (paragraph) msgid "The `createOrGetStripeCustomer` method may be used if you would like to retrieve the Stripe customer object for a given billable model but are not sure whether the billable model is already a customer within Stripe. This method will create a new customer in Stripe if one does not already exist:" msgstr "" -#: docs/10.x/billing.md:block 78 (code) +#: docs/10.x/billing.md:block 122 (code) msgid "$stripeCustomer = $user->createOrGetStripeCustomer();\n" msgstr "" -#: docs/10.x/billing.md:block 80 (header) +#: docs/10.x/billing.md:block 124 (header) msgid "Updating Customers" msgstr "" -#: docs/10.x/billing.md:block 81 (paragraph) +#: docs/10.x/billing.md:block 125 (paragraph) msgid "Occasionally, you may wish to update the Stripe customer directly with additional information. You may accomplish this using the `updateStripeCustomer` method. This method accepts an array of [customer update options supported by the Stripe API](https://stripe.com/docs/api/customers/update):" msgstr "" -#: docs/10.x/billing.md:block 82 (code) +#: docs/10.x/billing.md:block 126 (code) msgid "$stripeCustomer = $user->updateStripeCustomer($options);\n" msgstr "" -#: docs/10.x/billing.md:block 84 (header) +#: docs/10.x/billing.md:block 128 (header) msgid "Balances" msgstr "" -#: docs/10.x/billing.md:block 85 (paragraph) +#: docs/10.x/billing.md:block 129 (paragraph) msgid "Stripe allows you to credit or debit a customer's \"balance\". Later, this balance will be credited or debited on new invoices. To check the customer's total balance you may use the `balance` method that is available on your billable model. The `balance` method will return a formatted string representation of the balance in the customer's currency:" msgstr "" -#: docs/10.x/billing.md:block 86 (code) +#: docs/10.x/billing.md:block 130 (code) msgid "$balance = $user->balance();\n" msgstr "" -#: docs/10.x/billing.md:block 87 (paragraph) +#: docs/10.x/billing.md:block 131 (paragraph) msgid "To credit a customer's balance, you may provide a value to the `creditBalance` method. If you wish, you may also provide a description:" msgstr "" -#: docs/10.x/billing.md:block 88 (code) +#: docs/10.x/billing.md:block 132 (code) msgid "$user->creditBalance(500, 'Premium customer top-up.');\n" msgstr "" -#: docs/10.x/billing.md:block 89 (paragraph) +#: docs/10.x/billing.md:block 133 (paragraph) msgid "Providing a value to the `debitBalance` method will debit the customer's balance:" msgstr "" -#: docs/10.x/billing.md:block 90 (code) +#: docs/10.x/billing.md:block 134 (code) msgid "$user->debitBalance(300, 'Bad usage penalty.');\n" msgstr "" -#: docs/10.x/billing.md:block 91 (paragraph) +#: docs/10.x/billing.md:block 135 (paragraph) msgid "The `applyBalance` method will create new customer balance transactions for the customer. You may retrieve these transaction records using the `balanceTransactions` method, which may be useful in order to provide a log of credits and debits for the customer to review:" msgstr "" -#: docs/10.x/billing.md:block 92 (code) +#: docs/10.x/billing.md:block 136 (code) msgid "// Retrieve all transactions...\n" "$transactions = $user->balanceTransactions();\n\n" "foreach ($transactions as $transaction) {\n" @@ -633,59 +865,59 @@ msgid "// Retrieve all transactions...\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 94 (header) +#: docs/10.x/billing.md:block 138 (header) msgid "Tax IDs" msgstr "" -#: docs/10.x/billing.md:block 95 (paragraph) +#: docs/10.x/billing.md:block 139 (paragraph) msgid "Cashier offers an easy way to manage a customer's tax IDs. For example, the `taxIds` method may be used to retrieve all of the [tax IDs](https://stripe.com/docs/api/customer_tax_ids/object) that are assigned to a customer as a collection:" msgstr "" -#: docs/10.x/billing.md:block 96 (code) +#: docs/10.x/billing.md:block 140 (code) msgid "$taxIds = $user->taxIds();\n" msgstr "" -#: docs/10.x/billing.md:block 97 (paragraph) +#: docs/10.x/billing.md:block 141 (paragraph) msgid "You can also retrieve a specific tax ID for a customer by its identifier:" msgstr "" -#: docs/10.x/billing.md:block 98 (code) +#: docs/10.x/billing.md:block 142 (code) msgid "$taxId = $user->findTaxId('txi_belgium');\n" msgstr "" -#: docs/10.x/billing.md:block 99 (paragraph) +#: docs/10.x/billing.md:block 143 (paragraph) msgid "You may create a new Tax ID by providing a valid [type](https://stripe.com/docs/api/customer_tax_ids/object#tax_id_object-type) and value to the `createTaxId` method:" msgstr "" -#: docs/10.x/billing.md:block 100 (code) +#: docs/10.x/billing.md:block 144 (code) msgid "$taxId = $user->createTaxId('eu_vat', 'BE0123456789');\n" msgstr "" -#: docs/10.x/billing.md:block 101 (paragraph) +#: docs/10.x/billing.md:block 145 (paragraph) msgid "The `createTaxId` method will immediately add the VAT ID to the customer's account. [Verification of VAT IDs is also done by Stripe](https://stripe.com/docs/invoicing/customer/tax-ids#validation); however, this is an asynchronous process. You can be notified of verification updates by subscribing to the `customer.tax_id.updated` webhook event and inspecting [the VAT IDs `verification` parameter](https://stripe.com/docs/api/customer_tax_ids/object#tax_id_object-verification). For more information on handling webhooks, please consult the [documentation on defining webhook handlers](#handling-stripe-webhooks)." msgstr "" -#: docs/10.x/billing.md:block 102 (paragraph) +#: docs/10.x/billing.md:block 146 (paragraph) msgid "You may delete a tax ID using the `deleteTaxId` method:" msgstr "" -#: docs/10.x/billing.md:block 103 (code) +#: docs/10.x/billing.md:block 147 (code) msgid "$user->deleteTaxId('txi_belgium');\n" msgstr "" -#: docs/10.x/billing.md:block 105 (header) +#: docs/10.x/billing.md:block 149 (header) msgid "Syncing Customer Data With Stripe" msgstr "" -#: docs/10.x/billing.md:block 106 (paragraph) +#: docs/10.x/billing.md:block 150 (paragraph) msgid "Typically, when your application's users update their name, email address, or other information that is also stored by Stripe, you should inform Stripe of the updates. By doing so, Stripe's copy of the information will be in sync with your application's." msgstr "" -#: docs/10.x/billing.md:block 107 (paragraph) +#: docs/10.x/billing.md:block 151 (paragraph) msgid "To automate this, you may define an event listener on your billable model that reacts to the model's `updated` event. Then, within your event listener, you may invoke the `syncStripeCustomerDetails` method on the model:" msgstr "" -#: docs/10.x/billing.md:block 108 (code) +#: docs/10.x/billing.md:block 152 (code) msgid "use App\\Models\\User;\n" "use function Illuminate\\Events\\queueable;\n\n" "/**\n" @@ -701,15 +933,15 @@ msgid "use App\\Models\\User;\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 109 (paragraph) +#: docs/10.x/billing.md:block 153 (paragraph) msgid "Now, every time your customer model is updated, its information will be synced with Stripe. For convenience, Cashier will automatically sync your customer's information with Stripe on the initial creation of the customer." msgstr "" -#: docs/10.x/billing.md:block 110 (paragraph) +#: docs/10.x/billing.md:block 154 (paragraph) msgid "You may customize the columns used for syncing customer information to Stripe by overriding a variety of methods provided by Cashier. For example, you may override the `stripeName` method to customize the attribute that should be considered the customer's \"name\" when Cashier syncs customer information to Stripe:" msgstr "" -#: docs/10.x/billing.md:block 111 (code) +#: docs/10.x/billing.md:block 155 (code) msgid "/**\n" " * Get the customer name that should be synced to Stripe.\n" " */\n" @@ -719,75 +951,75 @@ msgid "/**\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 112 (paragraph) +#: docs/10.x/billing.md:block 156 (paragraph) msgid "Similarly, you may override the `stripeEmail`, `stripePhone`, `stripeAddress`, and `stripePreferredLocales` methods. These methods will sync information to their corresponding customer parameters when [updating the Stripe customer object](https://stripe.com/docs/api/customers/update). If you wish to take total control over the customer information sync process, you may override the `syncStripeCustomerDetails` method." msgstr "" -#: docs/10.x/billing.md:block 114 (header) +#: docs/10.x/billing.md:block 158 (header) msgid "Billing Portal" msgstr "" -#: docs/10.x/billing.md:block 115 (paragraph) +#: docs/10.x/billing.md:block 159 (paragraph) msgid "Stripe offers [an easy way to set up a billing portal](https://stripe.com/docs/billing/subscriptions/customer-portal) so that your customer can manage their subscription, payment methods, and view their billing history. You can redirect your users to the billing portal by invoking the `redirectToBillingPortal` method on the billable model from a controller or route:" msgstr "" -#: docs/10.x/billing.md:block 116 (code) +#: docs/10.x/billing.md:block 160 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::get('/billing-portal', function (Request $request) {\n" " return $request->user()->redirectToBillingPortal();\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 117 (paragraph) +#: docs/10.x/billing.md:block 161 (paragraph) msgid "By default, when the user is finished managing their subscription, they will be able to return to the `home` route of your application via a link within the Stripe billing portal. You may provide a custom URL that the user should return to by passing the URL as an argument to the `redirectToBillingPortal` method:" msgstr "" -#: docs/10.x/billing.md:block 118 (code) +#: docs/10.x/billing.md:block 162 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::get('/billing-portal', function (Request $request) {\n" " return $request->user()->redirectToBillingPortal(route('billing'));\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 119 (paragraph) +#: docs/10.x/billing.md:block 163 (paragraph) msgid "If you would like to generate the URL to the billing portal without generating an HTTP redirect response, you may invoke the `billingPortalUrl` method:" msgstr "" -#: docs/10.x/billing.md:block 120 (code) +#: docs/10.x/billing.md:block 164 (code) msgid "$url = $request->user()->billingPortalUrl(route('billing'));\n" msgstr "" -#: docs/10.x/billing.md:block 122 (header) +#: docs/10.x/billing.md:block 166 (header) msgid "Payment Methods" msgstr "" -#: docs/10.x/billing.md:block 124 (header) +#: docs/10.x/billing.md:block 168 (header) msgid "Storing Payment Methods" msgstr "" -#: docs/10.x/billing.md:block 125 (paragraph) +#: docs/10.x/billing.md:block 169 (paragraph) msgid "In order to create subscriptions or perform \"one-off\" charges with Stripe, you will need to store a payment method and retrieve its identifier from Stripe. The approach used to accomplish this differs based on whether you plan to use the payment method for subscriptions or single charges, so we will examine both below." msgstr "" -#: docs/10.x/billing.md:block 127 (header) -msgid "Payment Methods For Subscriptions" +#: docs/10.x/billing.md:block 171 (header) +msgid "Payment Methods for Subscriptions" msgstr "" -#: docs/10.x/billing.md:block 128 (paragraph) +#: docs/10.x/billing.md:block 172 (paragraph) msgid "When storing a customer's credit card information for future use by a subscription, the Stripe \"Setup Intents\" API must be used to securely gather the customer's payment method details. A \"Setup Intent\" indicates to Stripe the intention to charge a customer's payment method. Cashier's `Billable` trait includes the `createSetupIntent` method to easily create a new Setup Intent. You should invoke this method from the route or controller that will render the form which gathers your customer's payment method details:" msgstr "" -#: docs/10.x/billing.md:block 129 (code) +#: docs/10.x/billing.md:block 173 (code) msgid "return view('update-payment-method', [\n" " 'intent' => $user->createSetupIntent()\n" "]);\n" msgstr "" -#: docs/10.x/billing.md:block 130 (paragraph) +#: docs/10.x/billing.md:block 174 (paragraph) msgid "After you have created the Setup Intent and passed it to the view, you should attach its secret to the element that will gather the payment method. For example, consider this \"update payment method\" form:" msgstr "" -#: docs/10.x/billing.md:block 131 (code) +#: docs/10.x/billing.md:block 175 (code) msgid "\n\n" "\n" "
\n\n" @@ -796,11 +1028,11 @@ msgid "\n\n" "\n" msgstr "" -#: docs/10.x/billing.md:block 132 (paragraph) +#: docs/10.x/billing.md:block 176 (paragraph) msgid "Next, the Stripe.js library may be used to attach a [Stripe Element](https://stripe.com/docs/stripe-js) to the form and securely gather the customer's payment details:" msgstr "" -#: docs/10.x/billing.md:block 133 (code) +#: docs/10.x/billing.md:block 177 (code) msgid "\n\n" "\n\n" "\n" msgstr "" -#: docs/10.x/billing.md:block 134 (paragraph) +#: docs/10.x/billing.md:block 178 (paragraph) msgid "Next, the card can be verified and a secure \"payment method identifier\" can be retrieved from Stripe using [Stripe's `confirmCardSetup` method](https://stripe.com/docs/js/setup_intents/confirm_card_setup):" msgstr "" -#: docs/10.x/billing.md:block 135 (code) +#: docs/10.x/billing.md:block 179 (code) msgid "const cardHolderName = document.getElementById('card-holder-name');\n" "const cardButton = document.getElementById('card-button');\n" "const clientSecret = cardButton.dataset.secret;\n\n" @@ -835,23 +1067,23 @@ msgid "const cardHolderName = document.getElementById('card-holder-name');\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 136 (paragraph) +#: docs/10.x/billing.md:block 180 (paragraph) msgid "After the card has been verified by Stripe, you may pass the resulting `setupIntent.payment_method` identifier to your Laravel application, where it can be attached to the customer. The payment method can either be [added as a new payment method](#adding-payment-methods) or [used to update the default payment method](#updating-the-default-payment-method). You can also immediately use the payment method identifier to [create a new subscription](#creating-subscriptions)." msgstr "" -#: docs/10.x/billing.md:block 137 (quote) -msgid "**Note** If you would like more information about Setup Intents and gathering customer payment details please [review this overview provided by Stripe](https://stripe.com/docs/payments/save-and-reuse#php)." +#: docs/10.x/billing.md:block 181 (quote) +msgid "[!NOTE] If you would like more information about Setup Intents and gathering customer payment details please [review this overview provided by Stripe](https://stripe.com/docs/payments/save-and-reuse#php)." msgstr "" -#: docs/10.x/billing.md:block 139 (header) -msgid "Payment Methods For Single Charges" +#: docs/10.x/billing.md:block 183 (header) +msgid "Payment Methods for Single Charges" msgstr "" -#: docs/10.x/billing.md:block 140 (paragraph) +#: docs/10.x/billing.md:block 184 (paragraph) msgid "Of course, when making a single charge against a customer's payment method, we will only need to use a payment method identifier once. Due to Stripe limitations, you may not use the stored default payment method of a customer for single charges. You must allow the customer to enter their payment method details using the Stripe.js library. For example, consider the following form:" msgstr "" -#: docs/10.x/billing.md:block 141 (code) +#: docs/10.x/billing.md:block 185 (code) msgid "\n\n" "\n" "
\n\n" @@ -860,15 +1092,15 @@ msgid "\n\n" "\n" msgstr "" -#: docs/10.x/billing.md:block 142 (paragraph) +#: docs/10.x/billing.md:block 186 (paragraph) msgid "After defining such a form, the Stripe.js library may be used to attach a [Stripe Element](https://stripe.com/docs/stripe-js) to the form and securely gather the customer's payment details:" msgstr "" -#: docs/10.x/billing.md:block 144 (paragraph) +#: docs/10.x/billing.md:block 188 (paragraph) msgid "Next, the card can be verified and a secure \"payment method identifier\" can be retrieved from Stripe using [Stripe's `createPaymentMethod` method](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method):" msgstr "" -#: docs/10.x/billing.md:block 145 (code) +#: docs/10.x/billing.md:block 189 (code) msgid "const cardHolderName = document.getElementById('card-holder-name');\n" "const cardButton = document.getElementById('card-button');\n\n" "cardButton.addEventListener('click', async (e) => {\n" @@ -885,177 +1117,177 @@ msgid "const cardHolderName = document.getElementById('card-holder-name');\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 146 (paragraph) +#: docs/10.x/billing.md:block 190 (paragraph) msgid "If the card is verified successfully, you may pass the `paymentMethod.id` to your Laravel application and process a [single charge](#simple-charge)." msgstr "" -#: docs/10.x/billing.md:block 148 (header) +#: docs/10.x/billing.md:block 192 (header) msgid "Retrieving Payment Methods" msgstr "" -#: docs/10.x/billing.md:block 149 (paragraph) +#: docs/10.x/billing.md:block 193 (paragraph) msgid "The `paymentMethods` method on the billable model instance returns a collection of `Laravel\\Cashier\\PaymentMethod` instances:" msgstr "" -#: docs/10.x/billing.md:block 150 (code) +#: docs/10.x/billing.md:block 194 (code) msgid "$paymentMethods = $user->paymentMethods();\n" msgstr "" -#: docs/10.x/billing.md:block 151 (paragraph) -msgid "By default, this method will return payment methods of the `card` type. To retrieve payment methods of a different type, you may pass the `type` as an argument to the method:" +#: docs/10.x/billing.md:block 195 (paragraph) +msgid "By default, this method will return payment methods of every type. To retrieve payment methods of a specific type, you may pass the `type` as an argument to the method:" msgstr "" -#: docs/10.x/billing.md:block 152 (code) +#: docs/10.x/billing.md:block 196 (code) msgid "$paymentMethods = $user->paymentMethods('sepa_debit');\n" msgstr "" -#: docs/10.x/billing.md:block 153 (paragraph) +#: docs/10.x/billing.md:block 197 (paragraph) msgid "To retrieve the customer's default payment method, the `defaultPaymentMethod` method may be used:" msgstr "" -#: docs/10.x/billing.md:block 154 (code) +#: docs/10.x/billing.md:block 198 (code) msgid "$paymentMethod = $user->defaultPaymentMethod();\n" msgstr "" -#: docs/10.x/billing.md:block 155 (paragraph) +#: docs/10.x/billing.md:block 199 (paragraph) msgid "You can retrieve a specific payment method that is attached to the billable model using the `findPaymentMethod` method:" msgstr "" -#: docs/10.x/billing.md:block 156 (code) +#: docs/10.x/billing.md:block 200 (code) msgid "$paymentMethod = $user->findPaymentMethod($paymentMethodId);\n" msgstr "" -#: docs/10.x/billing.md:block 158 (header) -msgid "Determining If A User Has A Payment Method" +#: docs/10.x/billing.md:block 202 (header) +msgid "Payment Method Presence" msgstr "" -#: docs/10.x/billing.md:block 159 (paragraph) +#: docs/10.x/billing.md:block 203 (paragraph) msgid "To determine if a billable model has a default payment method attached to their account, invoke the `hasDefaultPaymentMethod` method:" msgstr "" -#: docs/10.x/billing.md:block 160 (code) +#: docs/10.x/billing.md:block 204 (code) msgid "if ($user->hasDefaultPaymentMethod()) {\n" " // ...\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 161 (paragraph) +#: docs/10.x/billing.md:block 205 (paragraph) msgid "You may use the `hasPaymentMethod` method to determine if a billable model has at least one payment method attached to their account:" msgstr "" -#: docs/10.x/billing.md:block 162 (code) +#: docs/10.x/billing.md:block 206 (code) msgid "if ($user->hasPaymentMethod()) {\n" " // ...\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 163 (paragraph) -msgid "This method will determine if the billable model has payment methods of the `card` type. To determine if a payment method of another type exists for the model, you may pass the `type` as an argument to the method:" +#: docs/10.x/billing.md:block 207 (paragraph) +msgid "This method will determine if the billable model has any payment method at all. To determine if a payment method of a specific type exists for the model, you may pass the `type` as an argument to the method:" msgstr "" -#: docs/10.x/billing.md:block 164 (code) +#: docs/10.x/billing.md:block 208 (code) msgid "if ($user->hasPaymentMethod('sepa_debit')) {\n" " // ...\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 166 (header) -msgid "Updating The Default Payment Method" +#: docs/10.x/billing.md:block 210 (header) +msgid "Updating the Default Payment Method" msgstr "" -#: docs/10.x/billing.md:block 167 (paragraph) +#: docs/10.x/billing.md:block 211 (paragraph) msgid "The `updateDefaultPaymentMethod` method may be used to update a customer's default payment method information. This method accepts a Stripe payment method identifier and will assign the new payment method as the default billing payment method:" msgstr "" -#: docs/10.x/billing.md:block 168 (code) +#: docs/10.x/billing.md:block 212 (code) msgid "$user->updateDefaultPaymentMethod($paymentMethod);\n" msgstr "" -#: docs/10.x/billing.md:block 169 (paragraph) +#: docs/10.x/billing.md:block 213 (paragraph) msgid "To sync your default payment method information with the customer's default payment method information in Stripe, you may use the `updateDefaultPaymentMethodFromStripe` method:" msgstr "" -#: docs/10.x/billing.md:block 170 (code) +#: docs/10.x/billing.md:block 214 (code) msgid "$user->updateDefaultPaymentMethodFromStripe();\n" msgstr "" -#: docs/10.x/billing.md:block 171 (quote) -msgid "**Warning** The default payment method on a customer can only be used for invoicing and creating new subscriptions. Due to limitations imposed by Stripe, it may not be used for single charges." +#: docs/10.x/billing.md:block 215 (quote) +msgid "[!WARNING] The default payment method on a customer can only be used for invoicing and creating new subscriptions. Due to limitations imposed by Stripe, it may not be used for single charges." msgstr "" -#: docs/10.x/billing.md:block 173 (header) +#: docs/10.x/billing.md:block 217 (header) msgid "Adding Payment Methods" msgstr "" -#: docs/10.x/billing.md:block 174 (paragraph) +#: docs/10.x/billing.md:block 218 (paragraph) msgid "To add a new payment method, you may call the `addPaymentMethod` method on the billable model, passing the payment method identifier:" msgstr "" -#: docs/10.x/billing.md:block 175 (code) +#: docs/10.x/billing.md:block 219 (code) msgid "$user->addPaymentMethod($paymentMethod);\n" msgstr "" -#: docs/10.x/billing.md:block 176 (quote) -msgid "**Note** To learn how to retrieve payment method identifiers please review the [payment method storage documentation](#storing-payment-methods)." +#: docs/10.x/billing.md:block 220 (quote) +msgid "[!NOTE] To learn how to retrieve payment method identifiers please review the [payment method storage documentation](#storing-payment-methods)." msgstr "" -#: docs/10.x/billing.md:block 178 (header) +#: docs/10.x/billing.md:block 222 (header) msgid "Deleting Payment Methods" msgstr "" -#: docs/10.x/billing.md:block 179 (paragraph) +#: docs/10.x/billing.md:block 223 (paragraph) msgid "To delete a payment method, you may call the `delete` method on the `Laravel\\Cashier\\PaymentMethod` instance you wish to delete:" msgstr "" -#: docs/10.x/billing.md:block 180 (code) +#: docs/10.x/billing.md:block 224 (code) msgid "$paymentMethod->delete();\n" msgstr "" -#: docs/10.x/billing.md:block 181 (paragraph) +#: docs/10.x/billing.md:block 225 (paragraph) msgid "The `deletePaymentMethod` method will delete a specific payment method from the billable model:" msgstr "" -#: docs/10.x/billing.md:block 182 (code) +#: docs/10.x/billing.md:block 226 (code) msgid "$user->deletePaymentMethod('pm_visa');\n" msgstr "" -#: docs/10.x/billing.md:block 183 (paragraph) +#: docs/10.x/billing.md:block 227 (paragraph) msgid "The `deletePaymentMethods` method will delete all of the payment method information for the billable model:" msgstr "" -#: docs/10.x/billing.md:block 184 (code) +#: docs/10.x/billing.md:block 228 (code) msgid "$user->deletePaymentMethods();\n" msgstr "" -#: docs/10.x/billing.md:block 185 (paragraph) -msgid "By default, this method will delete payment methods of the `card` type. To delete payment methods of a different type you can pass the `type` as an argument to the method:" +#: docs/10.x/billing.md:block 229 (paragraph) +msgid "By default, this method will delete payment methods of every type. To delete payment methods of a specific type you can pass the `type` as an argument to the method:" msgstr "" -#: docs/10.x/billing.md:block 186 (code) +#: docs/10.x/billing.md:block 230 (code) msgid "$user->deletePaymentMethods('sepa_debit');\n" msgstr "" -#: docs/10.x/billing.md:block 187 (quote) -msgid "**Warning** If a user has an active subscription, your application should not allow them to delete their default payment method." +#: docs/10.x/billing.md:block 231 (quote) +msgid "[!WARNING] If a user has an active subscription, your application should not allow them to delete their default payment method." msgstr "" -#: docs/10.x/billing.md:block 189 (header) +#: docs/10.x/billing.md:block 233 (header) msgid "Subscriptions" msgstr "" -#: docs/10.x/billing.md:block 190 (paragraph) +#: docs/10.x/billing.md:block 234 (paragraph) msgid "Subscriptions provide a way to set up recurring payments for your customers. Stripe subscriptions managed by Cashier provide support for multiple subscription prices, subscription quantities, trials, and more." msgstr "" -#: docs/10.x/billing.md:block 192 (header) +#: docs/10.x/billing.md:block 236 (header) msgid "Creating Subscriptions" msgstr "" -#: docs/10.x/billing.md:block 193 (paragraph) +#: docs/10.x/billing.md:block 237 (paragraph) msgid "To create a subscription, first retrieve an instance of your billable model, which typically will be an instance of `App\\Models\\User`. Once you have retrieved the model instance, you may use the `newSubscription` method to create the model's subscription:" msgstr "" -#: docs/10.x/billing.md:block 194 (code) +#: docs/10.x/billing.md:block 238 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::post('/user/subscribe', function (Request $request) {\n" " $request->user()->newSubscription(\n" @@ -1065,63 +1297,63 @@ msgid "use Illuminate\\Http\\Request;\n\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 195 (paragraph) -msgid "The first argument passed to the `newSubscription` method should be the internal name of the subscription. If your application only offers a single subscription, you might call this `default` or `primary`. This subscription name is only for internal application usage and is not meant to be shown to users. In addition, it should not contain spaces and it should never be changed after creating the subscription. The second argument is the specific price the user is subscribing to. This value should correspond to the price's identifier in Stripe." +#: docs/10.x/billing.md:block 239 (paragraph) +msgid "The first argument passed to the `newSubscription` method should be the internal type of the subscription. If your application only offers a single subscription, you might call this `default` or `primary`. This subscription type is only for internal application usage and is not meant to be shown to users. In addition, it should not contain spaces and it should never be changed after creating the subscription. The second argument is the specific price the user is subscribing to. This value should correspond to the price's identifier in Stripe." msgstr "" -#: docs/10.x/billing.md:block 196 (paragraph) +#: docs/10.x/billing.md:block 240 (paragraph) msgid "The `create` method, which accepts [a Stripe payment method identifier](#storing-payment-methods) or Stripe `PaymentMethod` object, will begin the subscription as well as update your database with the billable model's Stripe customer ID and other relevant billing information." msgstr "" -#: docs/10.x/billing.md:block 197 (quote) -msgid "**Warning** Passing a payment method identifier directly to the `create` subscription method will also automatically add it to the user's stored payment methods." +#: docs/10.x/billing.md:block 241 (quote) +msgid "[!WARNING] Passing a payment method identifier directly to the `create` subscription method will also automatically add it to the user's stored payment methods." msgstr "" -#: docs/10.x/billing.md:block 199 (header) -msgid "Collecting Recurring Payments Via Invoice Emails" +#: docs/10.x/billing.md:block 243 (header) +msgid "Collecting Recurring Payments via Invoice Emails" msgstr "" -#: docs/10.x/billing.md:block 200 (paragraph) +#: docs/10.x/billing.md:block 244 (paragraph) msgid "Instead of collecting a customer's recurring payments automatically, you may instruct Stripe to email an invoice to the customer each time their recurring payment is due. Then, the customer may manually pay the invoice once they receive it. The customer does not need to provide a payment method up front when collecting recurring payments via invoices:" msgstr "" -#: docs/10.x/billing.md:block 201 (code) +#: docs/10.x/billing.md:block 245 (code) msgid "$user->newSubscription('default', 'price_monthly')->createAndSendInvoice();\n" msgstr "" -#: docs/10.x/billing.md:block 202 (paragraph) +#: docs/10.x/billing.md:block 246 (paragraph) msgid "The amount of time a customer has to pay their invoice before their subscription is cancelled is determined by the `days_until_due` option. By default, this is 30 days; however, you may provide a specific value for this option if you wish:" msgstr "" -#: docs/10.x/billing.md:block 203 (code) +#: docs/10.x/billing.md:block 247 (code) msgid "$user->newSubscription('default', 'price_monthly')->createAndSendInvoice([], [\n" " 'days_until_due' => 30\n" "]);\n" msgstr "" -#: docs/10.x/billing.md:block 205 (header) +#: docs/10.x/billing.md:block 249 (header) msgid "Quantities" msgstr "" -#: docs/10.x/billing.md:block 206 (paragraph) +#: docs/10.x/billing.md:block 250 (paragraph) msgid "If you would like to set a specific [quantity](https://stripe.com/docs/billing/subscriptions/quantities) for the price when creating the subscription, you should invoke the `quantity` method on the subscription builder before creating the subscription:" msgstr "" -#: docs/10.x/billing.md:block 207 (code) +#: docs/10.x/billing.md:block 251 (code) msgid "$user->newSubscription('default', 'price_monthly')\n" " ->quantity(5)\n" " ->create($paymentMethod);\n" msgstr "" -#: docs/10.x/billing.md:block 209 (header) +#: docs/10.x/billing.md:block 253 (header) msgid "Additional Details" msgstr "" -#: docs/10.x/billing.md:block 210 (paragraph) +#: docs/10.x/billing.md:block 254 (paragraph) msgid "If you would like to specify additional [customer](https://stripe.com/docs/api/customers/create) or [subscription](https://stripe.com/docs/api/subscriptions/create) options supported by Stripe, you may do so by passing them as the second and third arguments to the `create` method:" msgstr "" -#: docs/10.x/billing.md:block 211 (code) +#: docs/10.x/billing.md:block 255 (code) msgid "$user->newSubscription('default', 'price_monthly')->create($paymentMethod, [\n" " 'email' => $email,\n" "], [\n" @@ -1129,54 +1361,54 @@ msgid "$user->newSubscription('default', 'price_monthly')->create($paymentMethod "]);\n" msgstr "" -#: docs/10.x/billing.md:block 213 (header) +#: docs/10.x/billing.md:block 257 (header) msgid "Coupons" msgstr "" -#: docs/10.x/billing.md:block 214 (paragraph) +#: docs/10.x/billing.md:block 258 (paragraph) msgid "If you would like to apply a coupon when creating the subscription, you may use the `withCoupon` method:" msgstr "" -#: docs/10.x/billing.md:block 215 (code) +#: docs/10.x/billing.md:block 259 (code) msgid "$user->newSubscription('default', 'price_monthly')\n" " ->withCoupon('code')\n" " ->create($paymentMethod);\n" msgstr "" -#: docs/10.x/billing.md:block 216 (paragraph) +#: docs/10.x/billing.md:block 260 (paragraph) msgid "Or, if you would like to apply a [Stripe promotion code](https://stripe.com/docs/billing/subscriptions/discounts/codes), you may use the `withPromotionCode` method:" msgstr "" -#: docs/10.x/billing.md:block 217 (code) +#: docs/10.x/billing.md:block 261 (code) msgid "$user->newSubscription('default', 'price_monthly')\n" " ->withPromotionCode('promo_code_id')\n" " ->create($paymentMethod);\n" msgstr "" -#: docs/10.x/billing.md:block 218 (paragraph) +#: docs/10.x/billing.md:block 262 (paragraph) msgid "The given promotion code ID should be the Stripe API ID assigned to the promotion code and not the customer facing promotion code. If you need to find a promotion code ID based on a given customer facing promotion code, you may use the `findPromotionCode` method:" msgstr "" -#: docs/10.x/billing.md:block 219 (code) +#: docs/10.x/billing.md:block 263 (code) msgid "// Find a promotion code ID by its customer facing code...\n" "$promotionCode = $user->findPromotionCode('SUMMERSALE');\n\n" "// Find an active promotion code ID by its customer facing code...\n" "$promotionCode = $user->findActivePromotionCode('SUMMERSALE');\n" msgstr "" -#: docs/10.x/billing.md:block 220 (paragraph) +#: docs/10.x/billing.md:block 264 (paragraph) msgid "In the example above, the returned `$promotionCode` object is an instance of `Laravel\\Cashier\\PromotionCode`. This class decorates an underlying `Stripe\\PromotionCode` object. You can retrieve the coupon related to the promotion code by invoking the `coupon` method:" msgstr "" -#: docs/10.x/billing.md:block 221 (code) +#: docs/10.x/billing.md:block 265 (code) msgid "$coupon = $user->findPromotionCode('SUMMERSALE')->coupon();\n" msgstr "" -#: docs/10.x/billing.md:block 222 (paragraph) +#: docs/10.x/billing.md:block 266 (paragraph) msgid "The coupon instance allows you to determine the discount amount and whether the coupon represents a fixed discount or percentage based discount:" msgstr "" -#: docs/10.x/billing.md:block 223 (code) +#: docs/10.x/billing.md:block 267 (code) msgid "if ($coupon->isPercentage()) {\n" " return $coupon->percentOff().'%'; // 21.5%\n" "} else {\n" @@ -1184,91 +1416,91 @@ msgid "if ($coupon->isPercentage()) {\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 224 (paragraph) +#: docs/10.x/billing.md:block 268 (paragraph) msgid "You can also retrieve the discounts that are currently applied to a customer or subscription:" msgstr "" -#: docs/10.x/billing.md:block 225 (code) +#: docs/10.x/billing.md:block 269 (code) msgid "$discount = $billable->discount();\n\n" "$discount = $subscription->discount();\n" msgstr "" -#: docs/10.x/billing.md:block 226 (paragraph) +#: docs/10.x/billing.md:block 270 (paragraph) msgid "The returned `Laravel\\Cashier\\Discount` instances decorate an underlying `Stripe\\Discount` object instance. You may retrieve the coupon related to this discount by invoking the `coupon` method:" msgstr "" -#: docs/10.x/billing.md:block 227 (code) +#: docs/10.x/billing.md:block 271 (code) msgid "$coupon = $subscription->discount()->coupon();\n" msgstr "" -#: docs/10.x/billing.md:block 228 (paragraph) +#: docs/10.x/billing.md:block 272 (paragraph) msgid "If you would like to apply a new coupon or promotion code to a customer or subscription, you may do so via the `applyCoupon` or `applyPromotionCode` methods:" msgstr "" -#: docs/10.x/billing.md:block 229 (code) +#: docs/10.x/billing.md:block 273 (code) msgid "$billable->applyCoupon('coupon_id');\n" "$billable->applyPromotionCode('promotion_code_id');\n\n" "$subscription->applyCoupon('coupon_id');\n" "$subscription->applyPromotionCode('promotion_code_id');\n" msgstr "" -#: docs/10.x/billing.md:block 230 (paragraph) +#: docs/10.x/billing.md:block 274 (paragraph) msgid "Remember, you should use the Stripe API ID assigned to the promotion code and not the customer facing promotion code. Only one coupon or promotion code can be applied to a customer or subscription at a given time." msgstr "" -#: docs/10.x/billing.md:block 231 (paragraph) +#: docs/10.x/billing.md:block 275 (paragraph) msgid "For more info on this subject, please consult the Stripe documentation regarding [coupons](https://stripe.com/docs/billing/subscriptions/coupons) and [promotion codes](https://stripe.com/docs/billing/subscriptions/coupons/codes)." msgstr "" -#: docs/10.x/billing.md:block 233 (header) +#: docs/10.x/billing.md:block 277 (header) msgid "Adding Subscriptions" msgstr "" -#: docs/10.x/billing.md:block 234 (paragraph) +#: docs/10.x/billing.md:block 278 (paragraph) msgid "If you would like to add a subscription to a customer who already has a default payment method you may invoke the `add` method on the subscription builder:" msgstr "" -#: docs/10.x/billing.md:block 235 (code) +#: docs/10.x/billing.md:block 279 (code) msgid "use App\\Models\\User;\n\n" "$user = User::find(1);\n\n" "$user->newSubscription('default', 'price_monthly')->add();\n" msgstr "" -#: docs/10.x/billing.md:block 237 (header) -msgid "Creating Subscriptions From The Stripe Dashboard" +#: docs/10.x/billing.md:block 281 (header) +msgid "Creating Subscriptions From the Stripe Dashboard" msgstr "" -#: docs/10.x/billing.md:block 238 (paragraph) -msgid "You may also create subscriptions from the Stripe dashboard itself. When doing so, Cashier will sync newly added subscriptions and assign them a name of `default`. To customize the subscription name that is assigned to dashboard created subscriptions, [extend the `WebhookController`](#defining-webhook-event-handlers) and overwrite the `newSubscriptionName` method." +#: docs/10.x/billing.md:block 282 (paragraph) +msgid "You may also create subscriptions from the Stripe dashboard itself. When doing so, Cashier will sync newly added subscriptions and assign them a type of `default`. To customize the subscription type that is assigned to dashboard created subscriptions, [define webhook event handlers](#defining-webhook-event-handlers)." msgstr "" -#: docs/10.x/billing.md:block 239 (paragraph) -msgid "In addition, you may only create one type of subscription via the Stripe dashboard. If your application offers multiple subscriptions that use different names, only one type of subscription may be added through the Stripe dashboard." +#: docs/10.x/billing.md:block 283 (paragraph) +msgid "In addition, you may only create one type of subscription via the Stripe dashboard. If your application offers multiple subscriptions that use different types, only one type of subscription may be added through the Stripe dashboard." msgstr "" -#: docs/10.x/billing.md:block 240 (paragraph) +#: docs/10.x/billing.md:block 284 (paragraph) msgid "Finally, you should always make sure to only add one active subscription per type of subscription offered by your application. If a customer has two `default` subscriptions, only the most recently added subscription will be used by Cashier even though both would be synced with your application's database." msgstr "" -#: docs/10.x/billing.md:block 242 (header) +#: docs/10.x/billing.md:block 286 (header) msgid "Checking Subscription Status" msgstr "" -#: docs/10.x/billing.md:block 243 (paragraph) -msgid "Once a customer is subscribed to your application, you may easily check their subscription status using a variety of convenient methods. First, the `subscribed` method returns `true` if the customer has an active subscription, even if the subscription is currently within its trial period. The `subscribed` method accepts the name of the subscription as its first argument:" +#: docs/10.x/billing.md:block 287 (paragraph) +msgid "Once a customer is subscribed to your application, you may easily check their subscription status using a variety of convenient methods. First, the `subscribed` method returns `true` if the customer has an active subscription, even if the subscription is currently within its trial period. The `subscribed` method accepts the type of the subscription as its first argument:" msgstr "" -#: docs/10.x/billing.md:block 244 (code) +#: docs/10.x/billing.md:block 288 (code) msgid "if ($user->subscribed('default')) {\n" " // ...\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 245 (paragraph) +#: docs/10.x/billing.md:block 289 (paragraph) msgid "The `subscribed` method also makes a great candidate for a [route middleware](/docs/{{version}}/middleware), allowing you to filter access to routes and controllers based on the user's subscription status:" msgstr "" -#: docs/10.x/billing.md:block 246 (code) +#: docs/10.x/billing.md:block 290 (code) msgid "subscription('default')->onTrial()) {\n" " // ...\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 249 (paragraph) +#: docs/10.x/billing.md:block 293 (paragraph) msgid "The `subscribedToProduct` method may be used to determine if the user is subscribed to a given product based on a given Stripe product's identifier. In Stripe, products are collections of prices. In this example, we will determine if the user's `default` subscription is actively subscribed to the application's \"premium\" product. The given Stripe product identifier should correspond to one of your product's identifiers in the Stripe dashboard:" msgstr "" -#: docs/10.x/billing.md:block 250 (code) +#: docs/10.x/billing.md:block 294 (code) msgid "if ($user->subscribedToProduct('prod_premium', 'default')) {\n" " // ...\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 251 (paragraph) +#: docs/10.x/billing.md:block 295 (paragraph) msgid "By passing an array to the `subscribedToProduct` method, you may determine if the user's `default` subscription is actively subscribed to the application's \"basic\" or \"premium\" product:" msgstr "" -#: docs/10.x/billing.md:block 252 (code) +#: docs/10.x/billing.md:block 296 (code) msgid "if ($user->subscribedToProduct(['prod_basic', 'prod_premium'], 'default')) {\n" " // ...\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 253 (paragraph) +#: docs/10.x/billing.md:block 297 (paragraph) msgid "The `subscribedToPrice` method may be used to determine if a customer's subscription corresponds to a given price ID:" msgstr "" -#: docs/10.x/billing.md:block 254 (code) +#: docs/10.x/billing.md:block 298 (code) msgid "if ($user->subscribedToPrice('price_basic_monthly', 'default')) {\n" " // ...\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 255 (paragraph) +#: docs/10.x/billing.md:block 299 (paragraph) msgid "The `recurring` method may be used to determine if the user is currently subscribed and is no longer within their trial period:" msgstr "" -#: docs/10.x/billing.md:block 256 (code) +#: docs/10.x/billing.md:block 300 (code) msgid "if ($user->subscription('default')->recurring()) {\n" " // ...\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 257 (quote) -msgid "**Warning** If a user has two subscriptions with the same name, the most recent subscription will always be returned by the `subscription` method. For example, a user might have two subscription records named `default`; however, one of the subscriptions may be an old, expired subscription, while the other is the current, active subscription. The most recent subscription will always be returned while older subscriptions are kept in the database for historical review." +#: docs/10.x/billing.md:block 301 (quote) +msgid "[!WARNING] If a user has two subscriptions with the same type, the most recent subscription will always be returned by the `subscription` method. For example, a user might have two subscription records with the type of `default`; however, one of the subscriptions may be an old, expired subscription, while the other is the current, active subscription. The most recent subscription will always be returned while older subscriptions are kept in the database for historical review." msgstr "" -#: docs/10.x/billing.md:block 259 (header) +#: docs/10.x/billing.md:block 303 (header) msgid "Canceled Subscription Status" msgstr "" -#: docs/10.x/billing.md:block 260 (paragraph) +#: docs/10.x/billing.md:block 304 (paragraph) msgid "To determine if the user was once an active subscriber but has canceled their subscription, you may use the `canceled` method:" msgstr "" -#: docs/10.x/billing.md:block 261 (code) +#: docs/10.x/billing.md:block 305 (code) msgid "if ($user->subscription('default')->canceled()) {\n" " // ...\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 262 (paragraph) +#: docs/10.x/billing.md:block 306 (paragraph) msgid "You may also determine if a user has canceled their subscription but are still on their \"grace period\" until the subscription fully expires. For example, if a user cancels a subscription on March 5th that was originally scheduled to expire on March 10th, the user is on their \"grace period\" until March 10th. Note that the `subscribed` method still returns `true` during this time:" msgstr "" -#: docs/10.x/billing.md:block 263 (code) +#: docs/10.x/billing.md:block 307 (code) msgid "if ($user->subscription('default')->onGracePeriod()) {\n" " // ...\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 264 (paragraph) +#: docs/10.x/billing.md:block 308 (paragraph) msgid "To determine if the user has canceled their subscription and is no longer within their \"grace period\", you may use the `ended` method:" msgstr "" -#: docs/10.x/billing.md:block 265 (code) +#: docs/10.x/billing.md:block 309 (code) msgid "if ($user->subscription('default')->ended()) {\n" " // ...\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 267 (header) +#: docs/10.x/billing.md:block 311 (header) msgid "Incomplete and Past Due Status" msgstr "" -#: docs/10.x/billing.md:block 268 (paragraph) +#: docs/10.x/billing.md:block 312 (paragraph) msgid "If a subscription requires a secondary payment action after creation the subscription will be marked as `incomplete`. Subscription statuses are stored in the `stripe_status` column of Cashier's `subscriptions` database table." msgstr "" -#: docs/10.x/billing.md:block 269 (paragraph) +#: docs/10.x/billing.md:block 313 (paragraph) msgid "Similarly, if a secondary payment action is required when swapping prices the subscription will be marked as `past_due`. When your subscription is in either of these states it will not be active until the customer has confirmed their payment. Determining if a subscription has an incomplete payment may be accomplished using the `hasIncompletePayment` method on the billable model or a subscription instance:" msgstr "" -#: docs/10.x/billing.md:block 270 (code) +#: docs/10.x/billing.md:block 314 (code) msgid "if ($user->hasIncompletePayment('default')) {\n" " // ...\n" "}\n\n" @@ -1401,21 +1633,21 @@ msgid "if ($user->hasIncompletePayment('default')) {\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 271 (paragraph) +#: docs/10.x/billing.md:block 315 (paragraph) msgid "When a subscription has an incomplete payment, you should direct the user to Cashier's payment confirmation page, passing the `latestPayment` identifier. You may use the `latestPayment` method available on subscription instance to retrieve this identifier:" msgstr "" -#: docs/10.x/billing.md:block 272 (code) +#: docs/10.x/billing.md:block 316 (code) msgid "latestPayment()->id) }}\">\n" " Please confirm your payment.\n" "\n" msgstr "" -#: docs/10.x/billing.md:block 273 (paragraph) +#: docs/10.x/billing.md:block 317 (paragraph) msgid "If you would like the subscription to still be considered active when it's in a `past_due` or `incomplete` state, you may use the `keepPastDueSubscriptionsActive` and `keepIncompleteSubscriptionsActive` methods provided by Cashier. Typically, these methods should be called in the `register` method of your `App\\Providers\\AppServiceProvider`:" msgstr "" -#: docs/10.x/billing.md:block 274 (code) +#: docs/10.x/billing.md:block 318 (code) msgid "use Laravel\\Cashier\\Cashier;\n\n" "/**\n" " * Register any application services.\n" @@ -1427,30 +1659,30 @@ msgid "use Laravel\\Cashier\\Cashier;\n\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 275 (quote) -msgid "**Warning** When a subscription is in an `incomplete` state it cannot be changed until the payment is confirmed. Therefore, the `swap` and `updateQuantity` methods will throw an exception when the subscription is in an `incomplete` state." +#: docs/10.x/billing.md:block 319 (quote) +msgid "[!WARNING] When a subscription is in an `incomplete` state it cannot be changed until the payment is confirmed. Therefore, the `swap` and `updateQuantity` methods will throw an exception when the subscription is in an `incomplete` state." msgstr "" -#: docs/10.x/billing.md:block 277 (header) +#: docs/10.x/billing.md:block 321 (header) msgid "Subscription Scopes" msgstr "" -#: docs/10.x/billing.md:block 278 (paragraph) +#: docs/10.x/billing.md:block 322 (paragraph) msgid "Most subscription states are also available as query scopes so that you may easily query your database for subscriptions that are in a given state:" msgstr "" -#: docs/10.x/billing.md:block 279 (code) +#: docs/10.x/billing.md:block 323 (code) msgid "// Get all active subscriptions...\n" "$subscriptions = Subscription::query()->active()->get();\n\n" "// Get all of the canceled subscriptions for a user...\n" "$subscriptions = $user->subscriptions()->canceled()->get();\n" msgstr "" -#: docs/10.x/billing.md:block 280 (paragraph) +#: docs/10.x/billing.md:block 324 (paragraph) msgid "A complete list of available scopes is available below:" msgstr "" -#: docs/10.x/billing.md:block 281 (code) +#: docs/10.x/billing.md:block 325 (code) msgid "Subscription::query()->active();\n" "Subscription::query()->canceled();\n" "Subscription::query()->ended();\n" @@ -1464,72 +1696,72 @@ msgid "Subscription::query()->active();\n" "Subscription::query()->recurring();\n" msgstr "" -#: docs/10.x/billing.md:block 283 (header) +#: docs/10.x/billing.md:block 327 (header) msgid "Changing Prices" msgstr "" -#: docs/10.x/billing.md:block 284 (paragraph) +#: docs/10.x/billing.md:block 328 (paragraph) msgid "After a customer is subscribed to your application, they may occasionally want to change to a new subscription price. To swap a customer to a new price, pass the Stripe price's identifier to the `swap` method. When swapping prices, it is assumed that the user would like to re-activate their subscription if it was previously canceled. The given price identifier should correspond to a Stripe price identifier available in the Stripe dashboard:" msgstr "" -#: docs/10.x/billing.md:block 285 (code) +#: docs/10.x/billing.md:block 329 (code) msgid "use App\\Models\\User;\n\n" "$user = App\\Models\\User::find(1);\n\n" "$user->subscription('default')->swap('price_yearly');\n" msgstr "" -#: docs/10.x/billing.md:block 286 (paragraph) +#: docs/10.x/billing.md:block 330 (paragraph) msgid "If the customer is on trial, the trial period will be maintained. Additionally, if a \"quantity\" exists for the subscription, that quantity will also be maintained." msgstr "" -#: docs/10.x/billing.md:block 287 (paragraph) +#: docs/10.x/billing.md:block 331 (paragraph) msgid "If you would like to swap prices and cancel any trial period the customer is currently on, you may invoke the `skipTrial` method:" msgstr "" -#: docs/10.x/billing.md:block 288 (code) +#: docs/10.x/billing.md:block 332 (code) msgid "$user->subscription('default')\n" " ->skipTrial()\n" " ->swap('price_yearly');\n" msgstr "" -#: docs/10.x/billing.md:block 289 (paragraph) +#: docs/10.x/billing.md:block 333 (paragraph) msgid "If you would like to swap prices and immediately invoice the customer instead of waiting for their next billing cycle, you may use the `swapAndInvoice` method:" msgstr "" -#: docs/10.x/billing.md:block 290 (code) +#: docs/10.x/billing.md:block 334 (code) msgid "$user = User::find(1);\n\n" "$user->subscription('default')->swapAndInvoice('price_yearly');\n" msgstr "" -#: docs/10.x/billing.md:block 292 (header) +#: docs/10.x/billing.md:block 336 (header) msgid "Prorations" msgstr "" -#: docs/10.x/billing.md:block 293 (paragraph) +#: docs/10.x/billing.md:block 337 (paragraph) msgid "By default, Stripe prorates charges when swapping between prices. The `noProrate` method may be used to update the subscription's price without prorating the charges:" msgstr "" -#: docs/10.x/billing.md:block 294 (code) +#: docs/10.x/billing.md:block 338 (code) msgid "$user->subscription('default')->noProrate()->swap('price_yearly');\n" msgstr "" -#: docs/10.x/billing.md:block 295 (paragraph) +#: docs/10.x/billing.md:block 339 (paragraph) msgid "For more information on subscription proration, consult the [Stripe documentation](https://stripe.com/docs/billing/subscriptions/prorations)." msgstr "" -#: docs/10.x/billing.md:block 296 (quote) -msgid "**Warning** Executing the `noProrate` method before the `swapAndInvoice` method will have no effect on proration. An invoice will always be issued." +#: docs/10.x/billing.md:block 340 (quote) +msgid "[!WARNING] Executing the `noProrate` method before the `swapAndInvoice` method will have no effect on proration. An invoice will always be issued." msgstr "" -#: docs/10.x/billing.md:block 298 (header) +#: docs/10.x/billing.md:block 342 (header) msgid "Subscription Quantity" msgstr "" -#: docs/10.x/billing.md:block 299 (paragraph) +#: docs/10.x/billing.md:block 343 (paragraph) msgid "Sometimes subscriptions are affected by \"quantity\". For example, a project management application might charge $10 per month per project. You may use the `incrementQuantity` and `decrementQuantity` methods to easily increment or decrement your subscription quantity:" msgstr "" -#: docs/10.x/billing.md:block 300 (code) +#: docs/10.x/billing.md:block 344 (code) msgid "use App\\Models\\User;\n\n" "$user = User::find(1);\n\n" "$user->subscription('default')->incrementQuantity();\n\n" @@ -1540,51 +1772,51 @@ msgid "use App\\Models\\User;\n\n" "$user->subscription('default')->decrementQuantity(5);\n" msgstr "" -#: docs/10.x/billing.md:block 301 (paragraph) +#: docs/10.x/billing.md:block 345 (paragraph) msgid "Alternatively, you may set a specific quantity using the `updateQuantity` method:" msgstr "" -#: docs/10.x/billing.md:block 302 (code) +#: docs/10.x/billing.md:block 346 (code) msgid "$user->subscription('default')->updateQuantity(10);\n" msgstr "" -#: docs/10.x/billing.md:block 303 (paragraph) +#: docs/10.x/billing.md:block 347 (paragraph) msgid "The `noProrate` method may be used to update the subscription's quantity without prorating the charges:" msgstr "" -#: docs/10.x/billing.md:block 304 (code) +#: docs/10.x/billing.md:block 348 (code) msgid "$user->subscription('default')->noProrate()->updateQuantity(10);\n" msgstr "" -#: docs/10.x/billing.md:block 305 (paragraph) +#: docs/10.x/billing.md:block 349 (paragraph) msgid "For more information on subscription quantities, consult the [Stripe documentation](https://stripe.com/docs/subscriptions/quantities)." msgstr "" -#: docs/10.x/billing.md:block 307 (header) -msgid "Quantities For Subscriptions With Multiple Products" +#: docs/10.x/billing.md:block 351 (header) +msgid "Quantities for Subscriptions With Multiple Products" msgstr "" -#: docs/10.x/billing.md:block 308 (paragraph) +#: docs/10.x/billing.md:block 352 (paragraph) msgid "If your subscription is a [subscription with multiple products](#subscriptions-with-multiple-products), you should pass the ID of the price whose quantity you wish to increment or decrement as the second argument to the increment / decrement methods:" msgstr "" -#: docs/10.x/billing.md:block 309 (code) +#: docs/10.x/billing.md:block 353 (code) msgid "$user->subscription('default')->incrementQuantity(1, 'price_chat');\n" msgstr "" -#: docs/10.x/billing.md:block 311 (header) +#: docs/10.x/billing.md:block 355 (header) msgid "Subscriptions With Multiple Products" msgstr "" -#: docs/10.x/billing.md:block 312 (paragraph) +#: docs/10.x/billing.md:block 356 (paragraph) msgid "[Subscription with multiple products](https://stripe.com/docs/billing/subscriptions/multiple-products) allow you to assign multiple billing products to a single subscription. For example, imagine you are building a customer service \"helpdesk\" application that has a base subscription price of $10 per month but offers a live chat add-on product for an additional $15 per month. Information for subscriptions with multiple products is stored in Cashier's `subscription_items` database table." msgstr "" -#: docs/10.x/billing.md:block 313 (paragraph) +#: docs/10.x/billing.md:block 357 (paragraph) msgid "You may specify multiple products for a given subscription by passing an array of prices as the second argument to the `newSubscription` method:" msgstr "" -#: docs/10.x/billing.md:block 314 (code) +#: docs/10.x/billing.md:block 358 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::post('/user/subscribe', function (Request $request) {\n" " $request->user()->newSubscription('default', [\n" @@ -1595,78 +1827,78 @@ msgid "use Illuminate\\Http\\Request;\n\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 315 (paragraph) +#: docs/10.x/billing.md:block 359 (paragraph) msgid "In the example above, the customer will have two prices attached to their `default` subscription. Both prices will be charged on their respective billing intervals. If necessary, you may use the `quantity` method to indicate a specific quantity for each price:" msgstr "" -#: docs/10.x/billing.md:block 316 (code) +#: docs/10.x/billing.md:block 360 (code) msgid "$user = User::find(1);\n\n" "$user->newSubscription('default', ['price_monthly', 'price_chat'])\n" " ->quantity(5, 'price_chat')\n" " ->create($paymentMethod);\n" msgstr "" -#: docs/10.x/billing.md:block 317 (paragraph) +#: docs/10.x/billing.md:block 361 (paragraph) msgid "If you would like to add another price to an existing subscription, you may invoke the subscription's `addPrice` method:" msgstr "" -#: docs/10.x/billing.md:block 318 (code) +#: docs/10.x/billing.md:block 362 (code) msgid "$user = User::find(1);\n\n" "$user->subscription('default')->addPrice('price_chat');\n" msgstr "" -#: docs/10.x/billing.md:block 319 (paragraph) +#: docs/10.x/billing.md:block 363 (paragraph) msgid "The example above will add the new price and the customer will be billed for it on their next billing cycle. If you would like to bill the customer immediately you may use the `addPriceAndInvoice` method:" msgstr "" -#: docs/10.x/billing.md:block 320 (code) +#: docs/10.x/billing.md:block 364 (code) msgid "$user->subscription('default')->addPriceAndInvoice('price_chat');\n" msgstr "" -#: docs/10.x/billing.md:block 321 (paragraph) +#: docs/10.x/billing.md:block 365 (paragraph) msgid "If you would like to add a price with a specific quantity, you can pass the quantity as the second argument of the `addPrice` or `addPriceAndInvoice` methods:" msgstr "" -#: docs/10.x/billing.md:block 322 (code) +#: docs/10.x/billing.md:block 366 (code) msgid "$user = User::find(1);\n\n" "$user->subscription('default')->addPrice('price_chat', 5);\n" msgstr "" -#: docs/10.x/billing.md:block 323 (paragraph) +#: docs/10.x/billing.md:block 367 (paragraph) msgid "You may remove prices from subscriptions using the `removePrice` method:" msgstr "" -#: docs/10.x/billing.md:block 324 (code) +#: docs/10.x/billing.md:block 368 (code) msgid "$user->subscription('default')->removePrice('price_chat');\n" msgstr "" -#: docs/10.x/billing.md:block 325 (quote) -msgid "**Warning** You may not remove the last price on a subscription. Instead, you should simply cancel the subscription." +#: docs/10.x/billing.md:block 369 (quote) +msgid "[!WARNING] You may not remove the last price on a subscription. Instead, you should simply cancel the subscription." msgstr "" -#: docs/10.x/billing.md:block 327 (header) +#: docs/10.x/billing.md:block 371 (header) msgid "Swapping Prices" msgstr "" -#: docs/10.x/billing.md:block 328 (paragraph) +#: docs/10.x/billing.md:block 372 (paragraph) msgid "You may also change the prices attached to a subscription with multiple products. For example, imagine a customer has a `price_basic` subscription with a `price_chat` add-on product and you want to upgrade the customer from the `price_basic` to the `price_pro` price:" msgstr "" -#: docs/10.x/billing.md:block 329 (code) +#: docs/10.x/billing.md:block 373 (code) msgid "use App\\Models\\User;\n\n" "$user = User::find(1);\n\n" "$user->subscription('default')->swap(['price_pro', 'price_chat']);\n" msgstr "" -#: docs/10.x/billing.md:block 330 (paragraph) +#: docs/10.x/billing.md:block 374 (paragraph) msgid "When executing the example above, the underlying subscription item with the `price_basic` is deleted and the one with the `price_chat` is preserved. Additionally, a new subscription item for the `price_pro` is created." msgstr "" -#: docs/10.x/billing.md:block 331 (paragraph) +#: docs/10.x/billing.md:block 375 (paragraph) msgid "You can also specify subscription item options by passing an array of key / value pairs to the `swap` method. For example, you may need to specify the subscription price quantities:" msgstr "" -#: docs/10.x/billing.md:block 332 (code) +#: docs/10.x/billing.md:block 376 (code) msgid "$user = User::find(1);\n\n" "$user->subscription('default')->swap([\n" " 'price_pro' => ['quantity' => 5],\n" @@ -1674,53 +1906,53 @@ msgid "$user = User::find(1);\n\n" "]);\n" msgstr "" -#: docs/10.x/billing.md:block 333 (paragraph) +#: docs/10.x/billing.md:block 377 (paragraph) msgid "If you want to swap a single price on a subscription, you may do so using the `swap` method on the subscription item itself. This approach is particularly useful if you would like to preserve all of the existing metadata on the subscription's other prices:" msgstr "" -#: docs/10.x/billing.md:block 334 (code) +#: docs/10.x/billing.md:block 378 (code) msgid "$user = User::find(1);\n\n" "$user->subscription('default')\n" " ->findItemOrFail('price_basic')\n" " ->swap('price_pro');\n" msgstr "" -#: docs/10.x/billing.md:block 336 (header) +#: docs/10.x/billing.md:block 380 (header) msgid "Proration" msgstr "" -#: docs/10.x/billing.md:block 337 (paragraph) +#: docs/10.x/billing.md:block 381 (paragraph) msgid "By default, Stripe will prorate charges when adding or removing prices from a subscription with multiple products. If you would like to make a price adjustment without proration, you should chain the `noProrate` method onto your price operation:" msgstr "" -#: docs/10.x/billing.md:block 338 (code) +#: docs/10.x/billing.md:block 382 (code) msgid "$user->subscription('default')->noProrate()->removePrice('price_chat');\n" msgstr "" -#: docs/10.x/billing.md:block 341 (paragraph) -msgid "If you would like to update quantities on individual subscription prices, you may do so using the [existing quantity methods](#subscription-quantity) by passing the name of the price as an additional argument to the method:" +#: docs/10.x/billing.md:block 385 (paragraph) +msgid "If you would like to update quantities on individual subscription prices, you may do so using the [existing quantity methods](#subscription-quantity) by passing the ID of the price as an additional argument to the method:" msgstr "" -#: docs/10.x/billing.md:block 342 (code) +#: docs/10.x/billing.md:block 386 (code) msgid "$user = User::find(1);\n\n" "$user->subscription('default')->incrementQuantity(5, 'price_chat');\n\n" "$user->subscription('default')->decrementQuantity(3, 'price_chat');\n\n" "$user->subscription('default')->updateQuantity(10, 'price_chat');\n" msgstr "" -#: docs/10.x/billing.md:block 343 (quote) -msgid "**Warning** When a subscription has multiple prices the `stripe_price` and `quantity` attributes on the `Subscription` model will be `null`. To access the individual price attributes, you should use the `items` relationship available on the `Subscription` model." +#: docs/10.x/billing.md:block 387 (quote) +msgid "[!WARNING] When a subscription has multiple prices the `stripe_price` and `quantity` attributes on the `Subscription` model will be `null`. To access the individual price attributes, you should use the `items` relationship available on the `Subscription` model." msgstr "" -#: docs/10.x/billing.md:block 345 (header) +#: docs/10.x/billing.md:block 389 (header) msgid "Subscription Items" msgstr "" -#: docs/10.x/billing.md:block 346 (paragraph) +#: docs/10.x/billing.md:block 390 (paragraph) msgid "When a subscription has multiple prices, it will have multiple subscription \"items\" stored in your database's `subscription_items` table. You may access these via the `items` relationship on the subscription:" msgstr "" -#: docs/10.x/billing.md:block 347 (code) +#: docs/10.x/billing.md:block 391 (code) msgid "use App\\Models\\User;\n\n" "$user = User::find(1);\n\n" "$subscriptionItem = $user->subscription('default')->items->first();\n\n" @@ -1729,28 +1961,28 @@ msgid "use App\\Models\\User;\n\n" "$quantity = $subscriptionItem->quantity;\n" msgstr "" -#: docs/10.x/billing.md:block 348 (paragraph) +#: docs/10.x/billing.md:block 392 (paragraph) msgid "You can also retrieve a specific price using the `findItemOrFail` method:" msgstr "" -#: docs/10.x/billing.md:block 349 (code) +#: docs/10.x/billing.md:block 393 (code) msgid "$user = User::find(1);\n\n" "$subscriptionItem = $user->subscription('default')->findItemOrFail('price_chat');\n" msgstr "" -#: docs/10.x/billing.md:block 351 (header) +#: docs/10.x/billing.md:block 395 (header) msgid "Multiple Subscriptions" msgstr "" -#: docs/10.x/billing.md:block 352 (paragraph) +#: docs/10.x/billing.md:block 396 (paragraph) msgid "Stripe allows your customers to have multiple subscriptions simultaneously. For example, you may run a gym that offers a swimming subscription and a weight-lifting subscription, and each subscription may have different pricing. Of course, customers should be able to subscribe to either or both plans." msgstr "" -#: docs/10.x/billing.md:block 353 (paragraph) -msgid "When your application creates subscriptions, you may provide the name of the subscription to the `newSubscription` method. The name may be any string that represents the type of subscription the user is initiating:" +#: docs/10.x/billing.md:block 397 (paragraph) +msgid "When your application creates subscriptions, you may provide the type of the subscription to the `newSubscription` method. The type may be any string that represents the type of subscription the user is initiating:" msgstr "" -#: docs/10.x/billing.md:block 354 (code) +#: docs/10.x/billing.md:block 398 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::post('/swimming/subscribe', function (Request $request) {\n" " $request->user()->newSubscription('swimming')\n" @@ -1760,35 +1992,35 @@ msgid "use Illuminate\\Http\\Request;\n\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 355 (paragraph) +#: docs/10.x/billing.md:block 399 (paragraph) msgid "In this example, we initiated a monthly swimming subscription for the customer. However, they may want to swap to a yearly subscription at a later time. When adjusting the customer's subscription, we can simply swap the price on the `swimming` subscription:" msgstr "" -#: docs/10.x/billing.md:block 356 (code) +#: docs/10.x/billing.md:block 400 (code) msgid "$user->subscription('swimming')->swap('price_swimming_yearly');\n" msgstr "" -#: docs/10.x/billing.md:block 357 (paragraph) +#: docs/10.x/billing.md:block 401 (paragraph) msgid "Of course, you may also cancel the subscription entirely:" msgstr "" -#: docs/10.x/billing.md:block 358 (code) +#: docs/10.x/billing.md:block 402 (code) msgid "$user->subscription('swimming')->cancel();\n" msgstr "" -#: docs/10.x/billing.md:block 360 (header) +#: docs/10.x/billing.md:block 404 (header) msgid "Metered Billing" msgstr "" -#: docs/10.x/billing.md:block 361 (paragraph) +#: docs/10.x/billing.md:block 405 (paragraph) msgid "[Metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) allows you to charge customers based on their product usage during a billing cycle. For example, you may charge customers based on the number of text messages or emails they send per month." msgstr "" -#: docs/10.x/billing.md:block 362 (paragraph) +#: docs/10.x/billing.md:block 406 (paragraph) msgid "To start using metered billing, you will first need to create a new product in your Stripe dashboard with a metered price. Then, use the `meteredPrice` to add the metered price ID to a customer subscription:" msgstr "" -#: docs/10.x/billing.md:block 363 (code) +#: docs/10.x/billing.md:block 407 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::post('/user/subscribe', function (Request $request) {\n" " $request->user()->newSubscription('default')\n" @@ -1798,11 +2030,11 @@ msgid "use Illuminate\\Http\\Request;\n\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 364 (paragraph) +#: docs/10.x/billing.md:block 408 (paragraph) msgid "You may also start a metered subscription via [Stripe Checkout](#checkout):" msgstr "" -#: docs/10.x/billing.md:block 365 (code) +#: docs/10.x/billing.md:block 409 (code) msgid "$checkout = Auth::user()\n" " ->newSubscription('default', [])\n" " ->meteredPrice('price_metered')\n" @@ -1812,73 +2044,73 @@ msgid "$checkout = Auth::user()\n" "]);\n" msgstr "" -#: docs/10.x/billing.md:block 367 (header) +#: docs/10.x/billing.md:block 411 (header) msgid "Reporting Usage" msgstr "" -#: docs/10.x/billing.md:block 368 (paragraph) +#: docs/10.x/billing.md:block 412 (paragraph) msgid "As your customer uses your application, you will report their usage to Stripe so that they can be billed accurately. To increment the usage of a metered subscription, you may use the `reportUsage` method:" msgstr "" -#: docs/10.x/billing.md:block 369 (code) +#: docs/10.x/billing.md:block 413 (code) msgid "$user = User::find(1);\n\n" "$user->subscription('default')->reportUsage();\n" msgstr "" -#: docs/10.x/billing.md:block 370 (paragraph) +#: docs/10.x/billing.md:block 414 (paragraph) msgid "By default, a \"usage quantity\" of 1 is added to the billing period. Alternatively, you may pass a specific amount of \"usage\" to add to the customer's usage for the billing period:" msgstr "" -#: docs/10.x/billing.md:block 371 (code) +#: docs/10.x/billing.md:block 415 (code) msgid "$user = User::find(1);\n\n" "$user->subscription('default')->reportUsage(15);\n" msgstr "" -#: docs/10.x/billing.md:block 372 (paragraph) +#: docs/10.x/billing.md:block 416 (paragraph) msgid "If your application offers multiple prices on a single subscription, you will need to use the `reportUsageFor` method to specify the metered price you want to report usage for:" msgstr "" -#: docs/10.x/billing.md:block 373 (code) +#: docs/10.x/billing.md:block 417 (code) msgid "$user = User::find(1);\n\n" "$user->subscription('default')->reportUsageFor('price_metered', 15);\n" msgstr "" -#: docs/10.x/billing.md:block 374 (paragraph) +#: docs/10.x/billing.md:block 418 (paragraph) msgid "Sometimes, you may need to update usage which you have previously reported. To accomplish this, you may pass a timestamp or a `DateTimeInterface` instance as the second parameter to `reportUsage`. When doing so, Stripe will update the usage that was reported at that given time. You can continue to update previous usage records as the given date and time is still within the current billing period:" msgstr "" -#: docs/10.x/billing.md:block 375 (code) +#: docs/10.x/billing.md:block 419 (code) msgid "$user = User::find(1);\n\n" "$user->subscription('default')->reportUsage(5, $timestamp);\n" msgstr "" -#: docs/10.x/billing.md:block 377 (header) +#: docs/10.x/billing.md:block 421 (header) msgid "Retrieving Usage Records" msgstr "" -#: docs/10.x/billing.md:block 378 (paragraph) +#: docs/10.x/billing.md:block 422 (paragraph) msgid "To retrieve a customer's past usage, you may use a subscription instance's `usageRecords` method:" msgstr "" -#: docs/10.x/billing.md:block 379 (code) +#: docs/10.x/billing.md:block 423 (code) msgid "$user = User::find(1);\n\n" "$usageRecords = $user->subscription('default')->usageRecords();\n" msgstr "" -#: docs/10.x/billing.md:block 380 (paragraph) +#: docs/10.x/billing.md:block 424 (paragraph) msgid "If your application offers multiple prices on a single subscription, you may use the `usageRecordsFor` method to specify the metered price that you wish to retrieve usage records for:" msgstr "" -#: docs/10.x/billing.md:block 381 (code) +#: docs/10.x/billing.md:block 425 (code) msgid "$user = User::find(1);\n\n" "$usageRecords = $user->subscription('default')->usageRecordsFor('price_metered');\n" msgstr "" -#: docs/10.x/billing.md:block 382 (paragraph) +#: docs/10.x/billing.md:block 426 (paragraph) msgid "The `usageRecords` and `usageRecordsFor` methods return a Collection instance containing an associative array of usage records. You may iterate over this array to display a customer's total usage:" msgstr "" -#: docs/10.x/billing.md:block 383 (code) +#: docs/10.x/billing.md:block 427 (code) msgid "@foreach ($usageRecords as $usageRecord)\n" " - Period Starting: {{ $usageRecord['period']['start'] }}\n" " - Period Ending: {{ $usageRecord['period']['end'] }}\n" @@ -1886,23 +2118,23 @@ msgid "@foreach ($usageRecords as $usageRecord)\n" "@endforeach\n" msgstr "" -#: docs/10.x/billing.md:block 384 (paragraph) +#: docs/10.x/billing.md:block 428 (paragraph) msgid "For a full reference of all usage data returned and how to use Stripe's cursor based pagination, please consult [the official Stripe API documentation](https://stripe.com/docs/api/usage_records/subscription_item_summary_list)." msgstr "" -#: docs/10.x/billing.md:block 386 (header) +#: docs/10.x/billing.md:block 430 (header) msgid "Subscription Taxes" msgstr "" -#: docs/10.x/billing.md:block 387 (quote) -msgid "**Warning** Instead of calculating Tax Rates manually, you can [automatically calculate taxes using Stripe Tax](#tax-configuration)" +#: docs/10.x/billing.md:block 431 (quote) +msgid "[!WARNING] Instead of calculating Tax Rates manually, you can [automatically calculate taxes using Stripe Tax](#tax-configuration)" msgstr "" -#: docs/10.x/billing.md:block 388 (paragraph) +#: docs/10.x/billing.md:block 432 (paragraph) msgid "To specify the tax rates a user pays on a subscription, you should implement the `taxRates` method on your billable model and return an array containing the Stripe tax rate IDs. You can define these tax rates in [your Stripe dashboard](https://dashboard.stripe.com/test/tax-rates):" msgstr "" -#: docs/10.x/billing.md:block 389 (code) +#: docs/10.x/billing.md:block 433 (code) msgid "/**\n" " * The tax rates that should apply to the customer's subscriptions.\n" " *\n" @@ -1914,15 +2146,15 @@ msgid "/**\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 390 (paragraph) +#: docs/10.x/billing.md:block 434 (paragraph) msgid "The `taxRates` method enables you to apply a tax rate on a customer-by-customer basis, which may be helpful for a user base that spans multiple countries and tax rates." msgstr "" -#: docs/10.x/billing.md:block 391 (paragraph) +#: docs/10.x/billing.md:block 435 (paragraph) msgid "If you're offering subscriptions with multiple products, you may define different tax rates for each price by implementing a `priceTaxRates` method on your billable model:" msgstr "" -#: docs/10.x/billing.md:block 392 (code) +#: docs/10.x/billing.md:block 436 (code) msgid "/**\n" " * The tax rates that should apply to the customer's subscriptions.\n" " *\n" @@ -1936,35 +2168,35 @@ msgid "/**\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 393 (quote) -msgid "**Warning** The `taxRates` method only applies to subscription charges. If you use Cashier to make \"one-off\" charges, you will need to manually specify the tax rate at that time." +#: docs/10.x/billing.md:block 437 (quote) +msgid "[!WARNING] The `taxRates` method only applies to subscription charges. If you use Cashier to make \"one-off\" charges, you will need to manually specify the tax rate at that time." msgstr "" -#: docs/10.x/billing.md:block 395 (header) +#: docs/10.x/billing.md:block 439 (header) msgid "Syncing Tax Rates" msgstr "" -#: docs/10.x/billing.md:block 396 (paragraph) +#: docs/10.x/billing.md:block 440 (paragraph) msgid "When changing the hard-coded tax rate IDs returned by the `taxRates` method, the tax settings on any existing subscriptions for the user will remain the same. If you wish to update the tax value for existing subscriptions with the new `taxRates` values, you should call the `syncTaxRates` method on the user's subscription instance:" msgstr "" -#: docs/10.x/billing.md:block 397 (code) +#: docs/10.x/billing.md:block 441 (code) msgid "$user->subscription('default')->syncTaxRates();\n" msgstr "" -#: docs/10.x/billing.md:block 398 (paragraph) +#: docs/10.x/billing.md:block 442 (paragraph) msgid "This will also sync any item tax rates for a subscription with multiple products. If your application is offering subscriptions with multiple products, you should ensure that your billable model implements the `priceTaxRates` method [discussed above](#subscription-taxes)." msgstr "" -#: docs/10.x/billing.md:block 400 (header) +#: docs/10.x/billing.md:block 444 (header) msgid "Tax Exemption" msgstr "" -#: docs/10.x/billing.md:block 401 (paragraph) +#: docs/10.x/billing.md:block 445 (paragraph) msgid "Cashier also offers the `isNotTaxExempt`, `isTaxExempt`, and `reverseChargeApplies` methods to determine if the customer is tax exempt. These methods will call the Stripe API to determine a customer's tax exemption status:" msgstr "" -#: docs/10.x/billing.md:block 402 (code) +#: docs/10.x/billing.md:block 446 (code) msgid "use App\\Models\\User;\n\n" "$user = User::find(1);\n\n" "$user->isTaxExempt();\n" @@ -1972,19 +2204,19 @@ msgid "use App\\Models\\User;\n\n" "$user->reverseChargeApplies();\n" msgstr "" -#: docs/10.x/billing.md:block 403 (quote) -msgid "**Warning** These methods are also available on any `Laravel\\Cashier\\Invoice` object. However, when invoked on an `Invoice` object, the methods will determine the exemption status at the time the invoice was created." +#: docs/10.x/billing.md:block 447 (quote) +msgid "[!WARNING] These methods are also available on any `Laravel\\Cashier\\Invoice` object. However, when invoked on an `Invoice` object, the methods will determine the exemption status at the time the invoice was created." msgstr "" -#: docs/10.x/billing.md:block 405 (header) +#: docs/10.x/billing.md:block 449 (header) msgid "Subscription Anchor Date" msgstr "" -#: docs/10.x/billing.md:block 406 (paragraph) +#: docs/10.x/billing.md:block 450 (paragraph) msgid "By default, the billing cycle anchor is the date the subscription was created or, if a trial period is used, the date that the trial ends. If you would like to modify the billing anchor date, you may use the `anchorBillingCycleOn` method:" msgstr "" -#: docs/10.x/billing.md:block 407 (code) +#: docs/10.x/billing.md:block 451 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::post('/user/subscribe', function (Request $request) {\n" " $anchor = Carbon::parse('first day of next month');\n\n" @@ -1995,89 +2227,98 @@ msgid "use Illuminate\\Http\\Request;\n\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 408 (paragraph) +#: docs/10.x/billing.md:block 452 (paragraph) msgid "For more information on managing subscription billing cycles, consult the [Stripe billing cycle documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle)" msgstr "" -#: docs/10.x/billing.md:block 410 (header) +#: docs/10.x/billing.md:block 454 (header) msgid "Cancelling Subscriptions" msgstr "" -#: docs/10.x/billing.md:block 411 (paragraph) +#: docs/10.x/billing.md:block 455 (paragraph) msgid "To cancel a subscription, call the `cancel` method on the user's subscription:" msgstr "" -#: docs/10.x/billing.md:block 412 (code) +#: docs/10.x/billing.md:block 456 (code) msgid "$user->subscription('default')->cancel();\n" msgstr "" -#: docs/10.x/billing.md:block 413 (paragraph) +#: docs/10.x/billing.md:block 457 (paragraph) msgid "When a subscription is canceled, Cashier will automatically set the `ends_at` column in your `subscriptions` database table. This column is used to know when the `subscribed` method should begin returning `false`." msgstr "" -#: docs/10.x/billing.md:block 414 (paragraph) +#: docs/10.x/billing.md:block 458 (paragraph) msgid "For example, if a customer cancels a subscription on March 1st, but the subscription was not scheduled to end until March 5th, the `subscribed` method will continue to return `true` until March 5th. This is done because a user is typically allowed to continue using an application until the end of their billing cycle." msgstr "" -#: docs/10.x/billing.md:block 415 (paragraph) +#: docs/10.x/billing.md:block 459 (paragraph) msgid "You may determine if a user has canceled their subscription but are still on their \"grace period\" using the `onGracePeriod` method:" msgstr "" -#: docs/10.x/billing.md:block 417 (paragraph) +#: docs/10.x/billing.md:block 461 (paragraph) msgid "If you wish to cancel a subscription immediately, call the `cancelNow` method on the user's subscription:" msgstr "" -#: docs/10.x/billing.md:block 418 (code) +#: docs/10.x/billing.md:block 462 (code) msgid "$user->subscription('default')->cancelNow();\n" msgstr "" -#: docs/10.x/billing.md:block 419 (paragraph) +#: docs/10.x/billing.md:block 463 (paragraph) msgid "If you wish to cancel a subscription immediately and invoice any remaining un-invoiced metered usage or new / pending proration invoice items, call the `cancelNowAndInvoice` method on the user's subscription:" msgstr "" -#: docs/10.x/billing.md:block 420 (code) +#: docs/10.x/billing.md:block 464 (code) msgid "$user->subscription('default')->cancelNowAndInvoice();\n" msgstr "" -#: docs/10.x/billing.md:block 421 (paragraph) +#: docs/10.x/billing.md:block 465 (paragraph) msgid "You may also choose to cancel the subscription at a specific moment in time:" msgstr "" -#: docs/10.x/billing.md:block 422 (code) +#: docs/10.x/billing.md:block 466 (code) msgid "$user->subscription('default')->cancelAt(\n" " now()->addDays(10)\n" ");\n" msgstr "" -#: docs/10.x/billing.md:block 424 (header) +#: docs/10.x/billing.md:block 467 (paragraph) +msgid "Finally, you should always cancel user subscriptions before deleting the associated user model:" +msgstr "" + +#: docs/10.x/billing.md:block 468 (code) +msgid "$user->subscription('default')->cancelNow();\n\n" +"$user->delete();\n" +msgstr "" + +#: docs/10.x/billing.md:block 470 (header) msgid "Resuming Subscriptions" msgstr "" -#: docs/10.x/billing.md:block 425 (paragraph) +#: docs/10.x/billing.md:block 471 (paragraph) msgid "If a customer has canceled their subscription and you wish to resume it, you may invoke the `resume` method on the subscription. The customer must still be within their \"grace period\" in order to resume a subscription:" msgstr "" -#: docs/10.x/billing.md:block 426 (code) +#: docs/10.x/billing.md:block 472 (code) msgid "$user->subscription('default')->resume();\n" msgstr "" -#: docs/10.x/billing.md:block 427 (paragraph) +#: docs/10.x/billing.md:block 473 (paragraph) msgid "If the customer cancels a subscription and then resumes that subscription before the subscription has fully expired the customer will not be billed immediately. Instead, their subscription will be re-activated and they will be billed on the original billing cycle." msgstr "" -#: docs/10.x/billing.md:block 429 (header) +#: docs/10.x/billing.md:block 475 (header) msgid "Subscription Trials" msgstr "" -#: docs/10.x/billing.md:block 431 (header) +#: docs/10.x/billing.md:block 477 (header) msgid "With Payment Method Up Front" msgstr "" -#: docs/10.x/billing.md:block 432 (paragraph) +#: docs/10.x/billing.md:block 478 (paragraph) msgid "If you would like to offer trial periods to your customers while still collecting payment method information up front, you should use the `trialDays` method when creating your subscriptions:" msgstr "" -#: docs/10.x/billing.md:block 433 (code) +#: docs/10.x/billing.md:block 479 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::post('/user/subscribe', function (Request $request) {\n" " $request->user()->newSubscription('default', 'price_monthly')\n" @@ -2087,30 +2328,30 @@ msgid "use Illuminate\\Http\\Request;\n\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 434 (paragraph) +#: docs/10.x/billing.md:block 480 (paragraph) msgid "This method will set the trial period ending date on the subscription record within the database and instruct Stripe to not begin billing the customer until after this date. When using the `trialDays` method, Cashier will overwrite any default trial period configured for the price in Stripe." msgstr "" -#: docs/10.x/billing.md:block 435 (quote) -msgid "**Warning** If the customer's subscription is not canceled before the trial ending date they will be charged as soon as the trial expires, so you should be sure to notify your users of their trial ending date." +#: docs/10.x/billing.md:block 481 (quote) +msgid "[!WARNING] If the customer's subscription is not canceled before the trial ending date they will be charged as soon as the trial expires, so you should be sure to notify your users of their trial ending date." msgstr "" -#: docs/10.x/billing.md:block 436 (paragraph) +#: docs/10.x/billing.md:block 482 (paragraph) msgid "The `trialUntil` method allows you to provide a `DateTime` instance that specifies when the trial period should end:" msgstr "" -#: docs/10.x/billing.md:block 437 (code) +#: docs/10.x/billing.md:block 483 (code) msgid "use Carbon\\Carbon;\n\n" "$user->newSubscription('default', 'price_monthly')\n" " ->trialUntil(Carbon::now()->addDays(10))\n" " ->create($paymentMethod);\n" msgstr "" -#: docs/10.x/billing.md:block 438 (paragraph) +#: docs/10.x/billing.md:block 484 (paragraph) msgid "You may determine if a user is within their trial period using either the `onTrial` method of the user instance or the `onTrial` method of the subscription instance. The two examples below are equivalent:" msgstr "" -#: docs/10.x/billing.md:block 439 (code) +#: docs/10.x/billing.md:block 485 (code) msgid "if ($user->onTrial('default')) {\n" " // ...\n" "}\n\n" @@ -2119,19 +2360,19 @@ msgid "if ($user->onTrial('default')) {\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 440 (paragraph) +#: docs/10.x/billing.md:block 486 (paragraph) msgid "You may use the `endTrial` method to immediately end a subscription trial:" msgstr "" -#: docs/10.x/billing.md:block 441 (code) +#: docs/10.x/billing.md:block 487 (code) msgid "$user->subscription('default')->endTrial();\n" msgstr "" -#: docs/10.x/billing.md:block 442 (paragraph) +#: docs/10.x/billing.md:block 488 (paragraph) msgid "To determine if an existing trial has expired, you may use the `hasExpiredTrial` methods:" msgstr "" -#: docs/10.x/billing.md:block 443 (code) +#: docs/10.x/billing.md:block 489 (code) msgid "if ($user->hasExpiredTrial('default')) {\n" " // ...\n" "}\n\n" @@ -2140,23 +2381,23 @@ msgid "if ($user->hasExpiredTrial('default')) {\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 445 (header) -msgid "Defining Trial Days In Stripe / Cashier" +#: docs/10.x/billing.md:block 491 (header) +msgid "Defining Trial Days in Stripe / Cashier" msgstr "" -#: docs/10.x/billing.md:block 446 (paragraph) +#: docs/10.x/billing.md:block 492 (paragraph) msgid "You may choose to define how many trial days your price's receive in the Stripe dashboard or always pass them explicitly using Cashier. If you choose to define your price's trial days in Stripe you should be aware that new subscriptions, including new subscriptions for a customer that had a subscription in the past, will always receive a trial period unless you explicitly call the `skipTrial()` method." msgstr "" -#: docs/10.x/billing.md:block 448 (header) +#: docs/10.x/billing.md:block 494 (header) msgid "Without Payment Method Up Front" msgstr "" -#: docs/10.x/billing.md:block 449 (paragraph) +#: docs/10.x/billing.md:block 495 (paragraph) msgid "If you would like to offer trial periods without collecting the user's payment method information up front, you may set the `trial_ends_at` column on the user record to your desired trial ending date. This is typically done during user registration:" msgstr "" -#: docs/10.x/billing.md:block 450 (code) +#: docs/10.x/billing.md:block 496 (code) msgid "use App\\Models\\User;\n\n" "$user = User::create([\n" " // ...\n" @@ -2164,58 +2405,58 @@ msgid "use App\\Models\\User;\n\n" "]);\n" msgstr "" -#: docs/10.x/billing.md:block 451 (quote) -msgid "**Warning** Be sure to add a [date cast](/docs/{{version}}/eloquent-mutators#date-casting) for the `trial_ends_at` attribute within your billable model's class definition." +#: docs/10.x/billing.md:block 497 (quote) +msgid "[!WARNING] Be sure to add a [date cast](/docs/{{version}}/eloquent-mutators#date-casting) for the `trial_ends_at` attribute within your billable model's class definition." msgstr "" -#: docs/10.x/billing.md:block 452 (paragraph) +#: docs/10.x/billing.md:block 498 (paragraph) msgid "Cashier refers to this type of trial as a \"generic trial\", since it is not attached to any existing subscription. The `onTrial` method on the billable model instance will return `true` if the current date is not past the value of `trial_ends_at`:" msgstr "" -#: docs/10.x/billing.md:block 453 (code) +#: docs/10.x/billing.md:block 499 (code) msgid "if ($user->onTrial()) {\n" " // User is within their trial period...\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 454 (paragraph) +#: docs/10.x/billing.md:block 500 (paragraph) msgid "Once you are ready to create an actual subscription for the user, you may use the `newSubscription` method as usual:" msgstr "" -#: docs/10.x/billing.md:block 455 (code) +#: docs/10.x/billing.md:block 501 (code) msgid "$user = User::find(1);\n\n" "$user->newSubscription('default', 'price_monthly')->create($paymentMethod);\n" msgstr "" -#: docs/10.x/billing.md:block 456 (paragraph) -msgid "To retrieve the user's trial ending date, you may use the `trialEndsAt` method. This method will return a Carbon date instance if a user is on a trial or `null` if they aren't. You may also pass an optional subscription name parameter if you would like to get the trial ending date for a specific subscription other than the default one:" +#: docs/10.x/billing.md:block 502 (paragraph) +msgid "To retrieve the user's trial ending date, you may use the `trialEndsAt` method. This method will return a Carbon date instance if a user is on a trial or `null` if they aren't. You may also pass an optional subscription type parameter if you would like to get the trial ending date for a specific subscription other than the default one:" msgstr "" -#: docs/10.x/billing.md:block 457 (code) +#: docs/10.x/billing.md:block 503 (code) msgid "if ($user->onTrial()) {\n" " $trialEndsAt = $user->trialEndsAt('main');\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 458 (paragraph) +#: docs/10.x/billing.md:block 504 (paragraph) msgid "You may also use the `onGenericTrial` method if you wish to know specifically that the user is within their \"generic\" trial period and has not yet created an actual subscription:" msgstr "" -#: docs/10.x/billing.md:block 459 (code) +#: docs/10.x/billing.md:block 505 (code) msgid "if ($user->onGenericTrial()) {\n" " // User is within their \"generic\" trial period...\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 461 (header) +#: docs/10.x/billing.md:block 507 (header) msgid "Extending Trials" msgstr "" -#: docs/10.x/billing.md:block 462 (paragraph) +#: docs/10.x/billing.md:block 508 (paragraph) msgid "The `extendTrial` method allows you to extend the trial period of a subscription after the subscription has been created. If the trial has already expired and the customer is already being billed for the subscription, you can still offer them an extended trial. The time spent within the trial period will be deducted from the customer's next invoice:" msgstr "" -#: docs/10.x/billing.md:block 463 (code) +#: docs/10.x/billing.md:block 509 (code) msgid "use App\\Models\\User;\n\n" "$subscription = User::find(1)->subscription('default');\n\n" "// End the trial 7 days from now...\n" @@ -2228,129 +2469,129 @@ msgid "use App\\Models\\User;\n\n" ");\n" msgstr "" -#: docs/10.x/billing.md:block 465 (header) +#: docs/10.x/billing.md:block 511 (header) msgid "Handling Stripe Webhooks" msgstr "" -#: docs/10.x/billing.md:block 466 (quote) -msgid "**Note** You may use [the Stripe CLI](https://stripe.com/docs/stripe-cli) to help test webhooks during local development." +#: docs/10.x/billing.md:block 512 (quote) +msgid "[!NOTE] You may use [the Stripe CLI](https://stripe.com/docs/stripe-cli) to help test webhooks during local development." msgstr "" -#: docs/10.x/billing.md:block 467 (paragraph) +#: docs/10.x/billing.md:block 513 (paragraph) msgid "Stripe can notify your application of a variety of events via webhooks. By default, a route that points to Cashier's webhook controller is automatically registered by the Cashier service provider. This controller will handle all incoming webhook requests." msgstr "" -#: docs/10.x/billing.md:block 468 (paragraph) +#: docs/10.x/billing.md:block 514 (paragraph) msgid "By default, the Cashier webhook controller will automatically handle cancelling subscriptions that have too many failed charges (as defined by your Stripe settings), customer updates, customer deletions, subscription updates, and payment method changes; however, as we'll soon discover, you can extend this controller to handle any Stripe webhook event you like." msgstr "" -#: docs/10.x/billing.md:block 469 (paragraph) +#: docs/10.x/billing.md:block 515 (paragraph) msgid "To ensure your application can handle Stripe webhooks, be sure to configure the webhook URL in the Stripe control panel. By default, Cashier's webhook controller responds to the `/stripe/webhook` URL path. The full list of all webhooks you should enable in the Stripe control panel are:" msgstr "" -#: docs/10.x/billing.md:block 470 (unordered list) +#: docs/10.x/billing.md:block 516 (unordered list) msgid "`customer.subscription.created`" msgstr "" -#: docs/10.x/billing.md:block 470 (unordered list) +#: docs/10.x/billing.md:block 516 (unordered list) msgid "`customer.subscription.updated`" msgstr "" -#: docs/10.x/billing.md:block 470 (unordered list) +#: docs/10.x/billing.md:block 516 (unordered list) msgid "`customer.subscription.deleted`" msgstr "" -#: docs/10.x/billing.md:block 470 (unordered list) +#: docs/10.x/billing.md:block 516 (unordered list) msgid "`customer.updated`" msgstr "" -#: docs/10.x/billing.md:block 470 (unordered list) +#: docs/10.x/billing.md:block 516 (unordered list) msgid "`customer.deleted`" msgstr "" -#: docs/10.x/billing.md:block 470 (unordered list) +#: docs/10.x/billing.md:block 516 (unordered list) msgid "`payment_method.automatically_updated`" msgstr "" -#: docs/10.x/billing.md:block 470 (unordered list) +#: docs/10.x/billing.md:block 516 (unordered list) msgid "`invoice.payment_action_required`" msgstr "" -#: docs/10.x/billing.md:block 470 (unordered list) +#: docs/10.x/billing.md:block 516 (unordered list) msgid "`invoice.payment_succeeded`" msgstr "" -#: docs/10.x/billing.md:block 471 (paragraph) +#: docs/10.x/billing.md:block 517 (paragraph) msgid "For convenience, Cashier includes a `cashier:webhook` Artisan command. This command will create a webhook in Stripe that listens to all of the events required by Cashier:" msgstr "" -#: docs/10.x/billing.md:block 472 (code) +#: docs/10.x/billing.md:block 518 (code) msgid "php artisan cashier:webhook\n" msgstr "" -#: docs/10.x/billing.md:block 473 (paragraph) +#: docs/10.x/billing.md:block 519 (paragraph) msgid "By default, the created webhook will point to the URL defined by the `APP_URL` environment variable and the `cashier.webhook` route that is included with Cashier. You may provide the `--url` option when invoking the command if you would like to use a different URL:" msgstr "" -#: docs/10.x/billing.md:block 474 (code) +#: docs/10.x/billing.md:block 520 (code) msgid "php artisan cashier:webhook --url \"https://example.com/stripe/webhook\"\n" msgstr "" -#: docs/10.x/billing.md:block 475 (paragraph) +#: docs/10.x/billing.md:block 521 (paragraph) msgid "The webhook that is created will use the Stripe API version that your version of Cashier is compatible with. If you would like to use a different Stripe version, you may provide the `--api-version` option:" msgstr "" -#: docs/10.x/billing.md:block 476 (code) +#: docs/10.x/billing.md:block 522 (code) msgid "php artisan cashier:webhook --api-version=\"2019-12-03\"\n" msgstr "" -#: docs/10.x/billing.md:block 477 (paragraph) +#: docs/10.x/billing.md:block 523 (paragraph) msgid "After creation, the webhook will be immediately active. If you wish to create the webhook but have it disabled until you're ready, you may provide the `--disabled` option when invoking the command:" msgstr "" -#: docs/10.x/billing.md:block 478 (code) +#: docs/10.x/billing.md:block 524 (code) msgid "php artisan cashier:webhook --disabled\n" msgstr "" -#: docs/10.x/billing.md:block 479 (quote) -msgid "**Warning** Make sure you protect incoming Stripe webhook requests with Cashier's included [webhook signature verification](#verifying-webhook-signatures) middleware." +#: docs/10.x/billing.md:block 525 (quote) +msgid "[!WARNING] Make sure you protect incoming Stripe webhook requests with Cashier's included [webhook signature verification](#verifying-webhook-signatures) middleware." msgstr "" -#: docs/10.x/billing.md:block 481 (header) -msgid "Webhooks & CSRF Protection" +#: docs/10.x/billing.md:block 527 (header) +msgid "Webhooks and CSRF Protection" msgstr "" -#: docs/10.x/billing.md:block 482 (paragraph) +#: docs/10.x/billing.md:block 528 (paragraph) msgid "Since Stripe webhooks need to bypass Laravel's [CSRF protection](/docs/{{version}}/csrf), be sure to list the URI as an exception in your application's `App\\Http\\Middleware\\VerifyCsrfToken` middleware or list the route outside of the `web` middleware group:" msgstr "" -#: docs/10.x/billing.md:block 483 (code) +#: docs/10.x/billing.md:block 529 (code) msgid "protected $except = [\n" " 'stripe/*',\n" "];\n" msgstr "" -#: docs/10.x/billing.md:block 485 (header) +#: docs/10.x/billing.md:block 531 (header) msgid "Defining Webhook Event Handlers" msgstr "" -#: docs/10.x/billing.md:block 486 (paragraph) +#: docs/10.x/billing.md:block 532 (paragraph) msgid "Cashier automatically handles subscription cancellations for failed charges and other common Stripe webhook events. However, if you have additional webhook events you would like to handle, you may do so by listening to the following events that are dispatched by Cashier:" msgstr "" -#: docs/10.x/billing.md:block 487 (unordered list) +#: docs/10.x/billing.md:block 533 (unordered list) msgid "`Laravel\\Cashier\\Events\\WebhookReceived`" msgstr "" -#: docs/10.x/billing.md:block 487 (unordered list) +#: docs/10.x/billing.md:block 533 (unordered list) msgid "`Laravel\\Cashier\\Events\\WebhookHandled`" msgstr "" -#: docs/10.x/billing.md:block 488 (paragraph) +#: docs/10.x/billing.md:block 534 (paragraph) msgid "Both events contain the full payload of the Stripe webhook. For example, if you wish to handle the `invoice.payment_succeeded` webhook, you may register a [listener](/docs/{{version}}/events#defining-listeners) that will handle the event:" msgstr "" -#: docs/10.x/billing.md:block 489 (code) +#: docs/10.x/billing.md:block 535 (code) msgid "user()->charge(\n" @@ -2422,30 +2663,30 @@ msgid "use Illuminate\\Http\\Request;\n\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 502 (paragraph) +#: docs/10.x/billing.md:block 548 (paragraph) msgid "The `charge` method accepts an array as its third argument, allowing you to pass any options you wish to the underlying Stripe charge creation. More information regarding the options available to you when creating charges may be found in the [Stripe documentation](https://stripe.com/docs/api/charges/create):" msgstr "" -#: docs/10.x/billing.md:block 503 (code) +#: docs/10.x/billing.md:block 549 (code) msgid "$user->charge(100, $paymentMethod, [\n" " 'custom_option' => $value,\n" "]);\n" msgstr "" -#: docs/10.x/billing.md:block 504 (paragraph) +#: docs/10.x/billing.md:block 550 (paragraph) msgid "You may also use the `charge` method without an underlying customer or user. To accomplish this, invoke the `charge` method on a new instance of your application's billable model:" msgstr "" -#: docs/10.x/billing.md:block 505 (code) +#: docs/10.x/billing.md:block 551 (code) msgid "use App\\Models\\User;\n\n" "$stripeCharge = (new User)->charge(100, $paymentMethod);\n" msgstr "" -#: docs/10.x/billing.md:block 506 (paragraph) +#: docs/10.x/billing.md:block 552 (paragraph) msgid "The `charge` method will throw an exception if the charge fails. If the charge is successful, an instance of `Laravel\\Cashier\\Payment` will be returned from the method:" msgstr "" -#: docs/10.x/billing.md:block 507 (code) +#: docs/10.x/billing.md:block 553 (code) msgid "try {\n" " $payment = $user->charge(100, $paymentMethod);\n" "} catch (Exception $e) {\n" @@ -2453,27 +2694,27 @@ msgid "try {\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 508 (quote) -msgid "**Warning** The `charge` method accepts the payment amount in the lowest denominator of the currency used by your application. For example, if customers are paying in United States Dollars, amounts should be specified in pennies." +#: docs/10.x/billing.md:block 554 (quote) +msgid "[!WARNING] The `charge` method accepts the payment amount in the lowest denominator of the currency used by your application. For example, if customers are paying in United States Dollars, amounts should be specified in pennies." msgstr "" -#: docs/10.x/billing.md:block 510 (header) +#: docs/10.x/billing.md:block 556 (header) msgid "Charge With Invoice" msgstr "" -#: docs/10.x/billing.md:block 511 (paragraph) -msgid "Sometimes you may need to make a one-time charge and offer a PDF receipt to your customer. The `invoicePrice` method lets you do just that. For example, let's invoice a customer for five new shirts:" +#: docs/10.x/billing.md:block 557 (paragraph) +msgid "Sometimes you may need to make a one-time charge and offer a PDF invoice to your customer. The `invoicePrice` method lets you do just that. For example, let's invoice a customer for five new shirts:" msgstr "" -#: docs/10.x/billing.md:block 512 (code) +#: docs/10.x/billing.md:block 558 (code) msgid "$user->invoicePrice('price_tshirt', 5);\n" msgstr "" -#: docs/10.x/billing.md:block 513 (paragraph) +#: docs/10.x/billing.md:block 559 (paragraph) msgid "The invoice will be immediately charged against the user's default payment method. The `invoicePrice` method also accepts an array as its third argument. This array contains the billing options for the invoice item. The fourth argument accepted by the method is also an array which should contain the billing options for the invoice itself:" msgstr "" -#: docs/10.x/billing.md:block 514 (code) +#: docs/10.x/billing.md:block 560 (code) msgid "$user->invoicePrice('price_tshirt', 5, [\n" " 'discounts' => [\n" " ['coupon' => 'SUMMER21SALE']\n" @@ -2483,41 +2724,41 @@ msgid "$user->invoicePrice('price_tshirt', 5, [\n" "]);\n" msgstr "" -#: docs/10.x/billing.md:block 515 (paragraph) +#: docs/10.x/billing.md:block 561 (paragraph) msgid "Similarly to `invoicePrice`, you may use the `tabPrice` method to create a one-time charge for multiple items (up to 250 items per invoice) by adding them to the customer's \"tab\" and then invoicing the customer. For example, we may invoice a customer for five shirts and two mugs:" msgstr "" -#: docs/10.x/billing.md:block 516 (code) +#: docs/10.x/billing.md:block 562 (code) msgid "$user->tabPrice('price_tshirt', 5);\n" "$user->tabPrice('price_mug', 2);\n" "$user->invoice();\n" msgstr "" -#: docs/10.x/billing.md:block 517 (paragraph) +#: docs/10.x/billing.md:block 563 (paragraph) msgid "Alternatively, you may use the `invoiceFor` method to make a \"one-off\" charge against the customer's default payment method:" msgstr "" -#: docs/10.x/billing.md:block 518 (code) +#: docs/10.x/billing.md:block 564 (code) msgid "$user->invoiceFor('One Time Fee', 500);\n" msgstr "" -#: docs/10.x/billing.md:block 519 (paragraph) +#: docs/10.x/billing.md:block 565 (paragraph) msgid "Although the `invoiceFor` method is available for you to use, it is recommended that you use the `invoicePrice` and `tabPrice` methods with pre-defined prices. By doing so, you will have access to better analytics and data within your Stripe dashboard regarding your sales on a per-product basis." msgstr "" -#: docs/10.x/billing.md:block 520 (quote) -msgid "**Warning** The `invoice`, `invoicePrice`, and `invoiceFor` methods will create a Stripe invoice which will retry failed billing attempts. If you do not want invoices to retry failed charges, you will need to close them using the Stripe API after the first failed charge." +#: docs/10.x/billing.md:block 566 (quote) +msgid "[!WARNING] The `invoice`, `invoicePrice`, and `invoiceFor` methods will create a Stripe invoice which will retry failed billing attempts. If you do not want invoices to retry failed charges, you will need to close them using the Stripe API after the first failed charge." msgstr "" -#: docs/10.x/billing.md:block 522 (header) +#: docs/10.x/billing.md:block 568 (header) msgid "Creating Payment Intents" msgstr "" -#: docs/10.x/billing.md:block 523 (paragraph) +#: docs/10.x/billing.md:block 569 (paragraph) msgid "You can create a new Stripe payment intent by invoking the `pay` method on a billable model instance. Calling this method will create a payment intent that is wrapped in a `Laravel\\Cashier\\Payment` instance:" msgstr "" -#: docs/10.x/billing.md:block 524 (code) +#: docs/10.x/billing.md:block 570 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::post('/pay', function (Request $request) {\n" " $payment = $request->user()->pay(\n" @@ -2527,15 +2768,15 @@ msgid "use Illuminate\\Http\\Request;\n\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 525 (paragraph) +#: docs/10.x/billing.md:block 571 (paragraph) msgid "After creating the payment intent, you can return the client secret to your application's frontend so that the user can complete the payment in their browser. To read more about building entire payment flows using Stripe payment intents, please consult the [Stripe documentation](https://stripe.com/docs/payments/accept-a-payment?platform=web)." msgstr "" -#: docs/10.x/billing.md:block 526 (paragraph) +#: docs/10.x/billing.md:block 572 (paragraph) msgid "When using the `pay` method, the default payment methods that are enabled within your Stripe dashboard will be available to the customer. Alternatively, if you only want to allow for some specific payment methods to be used, you may use the `payWith` method:" msgstr "" -#: docs/10.x/billing.md:block 527 (code) +#: docs/10.x/billing.md:block 573 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::post('/pay', function (Request $request) {\n" " $payment = $request->user()->payWith(\n" @@ -2545,64 +2786,64 @@ msgid "use Illuminate\\Http\\Request;\n\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 528 (quote) -msgid "**Warning** The `pay` and `payWith` methods accept the payment amount in the lowest denominator of the currency used by your application. For example, if customers are paying in United States Dollars, amounts should be specified in pennies." +#: docs/10.x/billing.md:block 574 (quote) +msgid "[!WARNING] The `pay` and `payWith` methods accept the payment amount in the lowest denominator of the currency used by your application. For example, if customers are paying in United States Dollars, amounts should be specified in pennies." msgstr "" -#: docs/10.x/billing.md:block 530 (header) +#: docs/10.x/billing.md:block 576 (header) msgid "Refunding Charges" msgstr "" -#: docs/10.x/billing.md:block 531 (paragraph) +#: docs/10.x/billing.md:block 577 (paragraph) msgid "If you need to refund a Stripe charge, you may use the `refund` method. This method accepts the Stripe [payment intent ID](#payment-methods-for-single-charges) as its first argument:" msgstr "" -#: docs/10.x/billing.md:block 532 (code) +#: docs/10.x/billing.md:block 578 (code) msgid "$payment = $user->charge(100, $paymentMethodId);\n\n" "$user->refund($payment->id);\n" msgstr "" -#: docs/10.x/billing.md:block 534 (header) +#: docs/10.x/billing.md:block 580 (header) msgid "Invoices" msgstr "" -#: docs/10.x/billing.md:block 536 (header) +#: docs/10.x/billing.md:block 582 (header) msgid "Retrieving Invoices" msgstr "" -#: docs/10.x/billing.md:block 537 (paragraph) +#: docs/10.x/billing.md:block 583 (paragraph) msgid "You may easily retrieve an array of a billable model's invoices using the `invoices` method. The `invoices` method returns a collection of `Laravel\\Cashier\\Invoice` instances:" msgstr "" -#: docs/10.x/billing.md:block 538 (code) +#: docs/10.x/billing.md:block 584 (code) msgid "$invoices = $user->invoices();\n" msgstr "" -#: docs/10.x/billing.md:block 539 (paragraph) +#: docs/10.x/billing.md:block 585 (paragraph) msgid "If you would like to include pending invoices in the results, you may use the `invoicesIncludingPending` method:" msgstr "" -#: docs/10.x/billing.md:block 540 (code) +#: docs/10.x/billing.md:block 586 (code) msgid "$invoices = $user->invoicesIncludingPending();\n" msgstr "" -#: docs/10.x/billing.md:block 541 (paragraph) +#: docs/10.x/billing.md:block 587 (paragraph) msgid "You may use the `findInvoice` method to retrieve a specific invoice by its ID:" msgstr "" -#: docs/10.x/billing.md:block 542 (code) +#: docs/10.x/billing.md:block 588 (code) msgid "$invoice = $user->findInvoice($invoiceId);\n" msgstr "" -#: docs/10.x/billing.md:block 544 (header) +#: docs/10.x/billing.md:block 590 (header) msgid "Displaying Invoice Information" msgstr "" -#: docs/10.x/billing.md:block 545 (paragraph) +#: docs/10.x/billing.md:block 591 (paragraph) msgid "When listing the invoices for the customer, you may use the invoice's methods to display the relevant invoice information. For example, you may wish to list every invoice in a table, allowing the user to easily download any of them:" msgstr "" -#: docs/10.x/billing.md:block 546 (code) +#: docs/10.x/billing.md:block 592 (code) msgid "\n" " @foreach ($invoices as $invoice)\n" " \n" @@ -2614,74 +2855,74 @@ msgid "
\n" "
\n" msgstr "" -#: docs/10.x/billing.md:block 548 (header) +#: docs/10.x/billing.md:block 594 (header) msgid "Upcoming Invoices" msgstr "" -#: docs/10.x/billing.md:block 549 (paragraph) +#: docs/10.x/billing.md:block 595 (paragraph) msgid "To retrieve the upcoming invoice for a customer, you may use the `upcomingInvoice` method:" msgstr "" -#: docs/10.x/billing.md:block 550 (code) +#: docs/10.x/billing.md:block 596 (code) msgid "$invoice = $user->upcomingInvoice();\n" msgstr "" -#: docs/10.x/billing.md:block 551 (paragraph) +#: docs/10.x/billing.md:block 597 (paragraph) msgid "Similarly, if the customer has multiple subscriptions, you can also retrieve the upcoming invoice for a specific subscription:" msgstr "" -#: docs/10.x/billing.md:block 552 (code) +#: docs/10.x/billing.md:block 598 (code) msgid "$invoice = $user->subscription('default')->upcomingInvoice();\n" msgstr "" -#: docs/10.x/billing.md:block 554 (header) +#: docs/10.x/billing.md:block 600 (header) msgid "Previewing Subscription Invoices" msgstr "" -#: docs/10.x/billing.md:block 555 (paragraph) +#: docs/10.x/billing.md:block 601 (paragraph) msgid "Using the `previewInvoice` method, you can preview an invoice before making price changes. This will allow you to determine what your customer's invoice will look like when a given price change is made:" msgstr "" -#: docs/10.x/billing.md:block 556 (code) +#: docs/10.x/billing.md:block 602 (code) msgid "$invoice = $user->subscription('default')->previewInvoice('price_yearly');\n" msgstr "" -#: docs/10.x/billing.md:block 557 (paragraph) +#: docs/10.x/billing.md:block 603 (paragraph) msgid "You may pass an array of prices to the `previewInvoice` method in order to preview invoices with multiple new prices:" msgstr "" -#: docs/10.x/billing.md:block 558 (code) +#: docs/10.x/billing.md:block 604 (code) msgid "$invoice = $user->subscription('default')->previewInvoice(['price_yearly', 'price_metered']);\n" msgstr "" -#: docs/10.x/billing.md:block 560 (header) +#: docs/10.x/billing.md:block 606 (header) msgid "Generating Invoice PDFs" msgstr "" -#: docs/10.x/billing.md:block 561 (paragraph) +#: docs/10.x/billing.md:block 607 (paragraph) msgid "Before generating invoice PDFs, you should use Composer to install the Dompdf library, which is the default invoice renderer for Cashier:" msgstr "" -#: docs/10.x/billing.md:block 562 (code) +#: docs/10.x/billing.md:block 608 (code) msgid "composer require dompdf/dompdf\n" msgstr "" -#: docs/10.x/billing.md:block 563 (paragraph) +#: docs/10.x/billing.md:block 609 (paragraph) msgid "From within a route or controller, you may use the `downloadInvoice` method to generate a PDF download of a given invoice. This method will automatically generate the proper HTTP response needed to download the invoice:" msgstr "" -#: docs/10.x/billing.md:block 564 (code) +#: docs/10.x/billing.md:block 610 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::get('/user/invoice/{invoice}', function (Request $request, string $invoiceId) {\n" " return $request->user()->downloadInvoice($invoiceId);\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 565 (paragraph) +#: docs/10.x/billing.md:block 611 (paragraph) msgid "By default, all data on the invoice is derived from the customer and invoice data stored in Stripe. The filename is based on your `app.name` config value. However, you can customize some of this data by providing an array as the second argument to the `downloadInvoice` method. This array allows you to customize information such as your company and product details:" msgstr "" -#: docs/10.x/billing.md:block 566 (code) +#: docs/10.x/billing.md:block 612 (code) msgid "return $request->user()->downloadInvoice($invoiceId, [\n" " 'vendor' => 'Your Company',\n" " 'product' => 'Your Product',\n" @@ -2694,23 +2935,23 @@ msgid "return $request->user()->downloadInvoice($invoiceId, [\n" "]);\n" msgstr "" -#: docs/10.x/billing.md:block 567 (paragraph) +#: docs/10.x/billing.md:block 613 (paragraph) msgid "The `downloadInvoice` method also allows for a custom filename via its third argument. This filename will automatically be suffixed with `.pdf`:" msgstr "" -#: docs/10.x/billing.md:block 568 (code) +#: docs/10.x/billing.md:block 614 (code) msgid "return $request->user()->downloadInvoice($invoiceId, [], 'my-invoice');\n" msgstr "" -#: docs/10.x/billing.md:block 570 (header) +#: docs/10.x/billing.md:block 616 (header) msgid "Custom Invoice Renderer" msgstr "" -#: docs/10.x/billing.md:block 571 (paragraph) +#: docs/10.x/billing.md:block 617 (paragraph) msgid "Cashier also makes it possible to use a custom invoice renderer. By default, Cashier uses the `DompdfInvoiceRenderer` implementation, which utilizes the [dompdf](https://github.com/dompdf/dompdf) PHP library to generate Cashier's invoices. However, you may use any renderer you wish by implementing the `Laravel\\Cashier\\Contracts\\InvoiceRenderer` interface. For example, you may wish to render an invoice PDF using an API call to a third-party PDF rendering service:" msgstr "" -#: docs/10.x/billing.md:block 572 (code) +#: docs/10.x/billing.md:block 618 (code) msgid "use Illuminate\\Support\\Facades\\Http;\n" "use Laravel\\Cashier\\Contracts\\InvoiceRenderer;\n" "use Laravel\\Cashier\\Invoice;\n\n" @@ -2727,53 +2968,53 @@ msgid "use Illuminate\\Support\\Facades\\Http;\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 573 (paragraph) +#: docs/10.x/billing.md:block 619 (paragraph) msgid "Once you have implemented the invoice renderer contract, you should update the `cashier.invoices.renderer` configuration value in your application's `config/cashier.php` configuration file. This configuration value should be set to the class name of your custom renderer implementation." msgstr "" -#: docs/10.x/billing.md:block 575 (header) +#: docs/10.x/billing.md:block 621 (header) msgid "Checkout" msgstr "" -#: docs/10.x/billing.md:block 576 (paragraph) +#: docs/10.x/billing.md:block 622 (paragraph) msgid "Cashier Stripe also provides support for [Stripe Checkout](https://stripe.com/payments/checkout). Stripe Checkout takes the pain out of implementing custom pages to accept payments by providing a pre-built, hosted payment page." msgstr "" -#: docs/10.x/billing.md:block 577 (paragraph) +#: docs/10.x/billing.md:block 623 (paragraph) msgid "The following documentation contains information on how to get started using Stripe Checkout with Cashier. To learn more about Stripe Checkout, you should also consider reviewing [Stripe's own documentation on Checkout](https://stripe.com/docs/payments/checkout)." msgstr "" -#: docs/10.x/billing.md:block 579 (header) +#: docs/10.x/billing.md:block 625 (header) msgid "Product Checkouts" msgstr "" -#: docs/10.x/billing.md:block 580 (paragraph) +#: docs/10.x/billing.md:block 626 (paragraph) msgid "You may perform a checkout for an existing product that has been created within your Stripe dashboard using the `checkout` method on a billable model. The `checkout` method will initiate a new Stripe Checkout session. By default, you're required to pass a Stripe Price ID:" msgstr "" -#: docs/10.x/billing.md:block 581 (code) +#: docs/10.x/billing.md:block 627 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::get('/product-checkout', function (Request $request) {\n" " return $request->user()->checkout('price_tshirt');\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 582 (paragraph) +#: docs/10.x/billing.md:block 628 (paragraph) msgid "If needed, you may also specify a product quantity:" msgstr "" -#: docs/10.x/billing.md:block 583 (code) +#: docs/10.x/billing.md:block 629 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::get('/product-checkout', function (Request $request) {\n" " return $request->user()->checkout(['price_tshirt' => 15]);\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 584 (paragraph) +#: docs/10.x/billing.md:block 630 (paragraph) msgid "When a customer visits this route they will be redirected to Stripe's Checkout page. By default, when a user successfully completes or cancels a purchase they will be redirected to your `home` route location, but you may specify custom callback URLs using the `success_url` and `cancel_url` options:" msgstr "" -#: docs/10.x/billing.md:block 585 (code) +#: docs/10.x/billing.md:block 631 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::get('/product-checkout', function (Request $request) {\n" " return $request->user()->checkout(['price_tshirt' => 1], [\n" @@ -2783,11 +3024,11 @@ msgid "use Illuminate\\Http\\Request;\n\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 586 (paragraph) +#: docs/10.x/billing.md:block 632 (paragraph) msgid "When defining your `success_url` checkout option, you may instruct Stripe to add the checkout session ID as a query string parameter when invoking your URL. To do so, add the literal string `{CHECKOUT_SESSION_ID}` to your `success_url` query string. Stripe will replace this placeholder with the actual checkout session ID:" msgstr "" -#: docs/10.x/billing.md:block 587 (code) +#: docs/10.x/billing.md:block 633 (code) msgid "use Illuminate\\Http\\Request;\n" "use Stripe\\Checkout\\Session;\n" "use Stripe\\Customer;\n\n" @@ -2803,15 +3044,15 @@ msgid "use Illuminate\\Http\\Request;\n" "})->name('checkout-success');\n" msgstr "" -#: docs/10.x/billing.md:block 589 (header) +#: docs/10.x/billing.md:block 635 (header) msgid "Promotion Codes" msgstr "" -#: docs/10.x/billing.md:block 590 (paragraph) +#: docs/10.x/billing.md:block 636 (paragraph) msgid "By default, Stripe Checkout does not allow [user redeemable promotion codes](https://stripe.com/docs/billing/subscriptions/discounts/codes). Luckily, there's an easy way to enable these for your Checkout page. To do so, you may invoke the `allowPromotionCodes` method:" msgstr "" -#: docs/10.x/billing.md:block 591 (code) +#: docs/10.x/billing.md:block 637 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::get('/product-checkout', function (Request $request) {\n" " return $request->user()\n" @@ -2820,38 +3061,38 @@ msgid "use Illuminate\\Http\\Request;\n\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 593 (header) +#: docs/10.x/billing.md:block 639 (header) msgid "Single Charge Checkouts" msgstr "" -#: docs/10.x/billing.md:block 594 (paragraph) +#: docs/10.x/billing.md:block 640 (paragraph) msgid "You can also perform a simple charge for an ad-hoc product that has not been created in your Stripe dashboard. To do so you may use the `checkoutCharge` method on a billable model and pass it a chargeable amount, a product name, and an optional quantity. When a customer visits this route they will be redirected to Stripe's Checkout page:" msgstr "" -#: docs/10.x/billing.md:block 595 (code) +#: docs/10.x/billing.md:block 641 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::get('/charge-checkout', function (Request $request) {\n" " return $request->user()->checkoutCharge(1200, 'T-Shirt', 5);\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 596 (quote) -msgid "**Warning** When using the `checkoutCharge` method, Stripe will always create a new product and price in your Stripe dashboard. Therefore, we recommend that you create the products up front in your Stripe dashboard and use the `checkout` method instead." +#: docs/10.x/billing.md:block 642 (quote) +msgid "[!WARNING] When using the `checkoutCharge` method, Stripe will always create a new product and price in your Stripe dashboard. Therefore, we recommend that you create the products up front in your Stripe dashboard and use the `checkout` method instead." msgstr "" -#: docs/10.x/billing.md:block 598 (header) +#: docs/10.x/billing.md:block 644 (header) msgid "Subscription Checkouts" msgstr "" -#: docs/10.x/billing.md:block 599 (quote) -msgid "**Warning** Using Stripe Checkout for subscriptions requires you to enable the `customer.subscription.created` webhook in your Stripe dashboard. This webhook will create the subscription record in your database and store all of the relevant subscription items." +#: docs/10.x/billing.md:block 645 (quote) +msgid "[!WARNING] Using Stripe Checkout for subscriptions requires you to enable the `customer.subscription.created` webhook in your Stripe dashboard. This webhook will create the subscription record in your database and store all of the relevant subscription items." msgstr "" -#: docs/10.x/billing.md:block 600 (paragraph) +#: docs/10.x/billing.md:block 646 (paragraph) msgid "You may also use Stripe Checkout to initiate subscriptions. After defining your subscription with Cashier's subscription builder methods, you may call the `checkout `method. When a customer visits this route they will be redirected to Stripe's Checkout page:" msgstr "" -#: docs/10.x/billing.md:block 601 (code) +#: docs/10.x/billing.md:block 647 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::get('/subscription-checkout', function (Request $request) {\n" " return $request->user()\n" @@ -2860,11 +3101,11 @@ msgid "use Illuminate\\Http\\Request;\n\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 602 (paragraph) +#: docs/10.x/billing.md:block 648 (paragraph) msgid "Just as with product checkouts, you may customize the success and cancellation URLs:" msgstr "" -#: docs/10.x/billing.md:block 603 (code) +#: docs/10.x/billing.md:block 649 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::get('/subscription-checkout', function (Request $request) {\n" " return $request->user()\n" @@ -2876,11 +3117,11 @@ msgid "use Illuminate\\Http\\Request;\n\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 604 (paragraph) +#: docs/10.x/billing.md:block 650 (paragraph) msgid "Of course, you can also enable promotion codes for subscription checkouts:" msgstr "" -#: docs/10.x/billing.md:block 605 (code) +#: docs/10.x/billing.md:block 651 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::get('/subscription-checkout', function (Request $request) {\n" " return $request->user()\n" @@ -2890,65 +3131,65 @@ msgid "use Illuminate\\Http\\Request;\n\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 606 (quote) -msgid "**Warning** Unfortunately Stripe Checkout does not support all subscription billing options when starting subscriptions. Using the `anchorBillingCycleOn` method on the subscription builder, setting proration behavior, or setting payment behavior will not have any effect during Stripe Checkout sessions. Please consult [the Stripe Checkout Session API documentation](https://stripe.com/docs/api/checkout/sessions/create) to review which parameters are available." +#: docs/10.x/billing.md:block 652 (quote) +msgid "[!WARNING] Unfortunately Stripe Checkout does not support all subscription billing options when starting subscriptions. Using the `anchorBillingCycleOn` method on the subscription builder, setting proration behavior, or setting payment behavior will not have any effect during Stripe Checkout sessions. Please consult [the Stripe Checkout Session API documentation](https://stripe.com/docs/api/checkout/sessions/create) to review which parameters are available." msgstr "" -#: docs/10.x/billing.md:block 608 (header) -msgid "Stripe Checkout & Trial Periods" +#: docs/10.x/billing.md:block 654 (header) +msgid "Stripe Checkout and Trial Periods" msgstr "" -#: docs/10.x/billing.md:block 609 (paragraph) +#: docs/10.x/billing.md:block 655 (paragraph) msgid "Of course, you can define a trial period when building a subscription that will be completed using Stripe Checkout:" msgstr "" -#: docs/10.x/billing.md:block 610 (code) +#: docs/10.x/billing.md:block 656 (code) msgid "$checkout = Auth::user()->newSubscription('default', 'price_monthly')\n" " ->trialDays(3)\n" " ->checkout();\n" msgstr "" -#: docs/10.x/billing.md:block 611 (paragraph) +#: docs/10.x/billing.md:block 657 (paragraph) msgid "However, the trial period must be at least 48 hours, which is the minimum amount of trial time supported by Stripe Checkout." msgstr "" -#: docs/10.x/billing.md:block 613 (header) -msgid "Subscriptions & Webhooks" +#: docs/10.x/billing.md:block 659 (header) +msgid "Subscriptions and Webhooks" msgstr "" -#: docs/10.x/billing.md:block 614 (paragraph) +#: docs/10.x/billing.md:block 660 (paragraph) msgid "Remember, Stripe and Cashier update subscription statuses via webhooks, so there's a possibility a subscription might not yet be active when the customer returns to the application after entering their payment information. To handle this scenario, you may wish to display a message informing the user that their payment or subscription is pending." msgstr "" -#: docs/10.x/billing.md:block 616 (header) +#: docs/10.x/billing.md:block 662 (header) msgid "Collecting Tax IDs" msgstr "" -#: docs/10.x/billing.md:block 617 (paragraph) +#: docs/10.x/billing.md:block 663 (paragraph) msgid "Checkout also supports collecting a customer's Tax ID. To enable this on a checkout session, invoke the `collectTaxIds` method when creating the session:" msgstr "" -#: docs/10.x/billing.md:block 618 (code) +#: docs/10.x/billing.md:block 664 (code) msgid "$checkout = $user->collectTaxIds()->checkout('price_tshirt');\n" msgstr "" -#: docs/10.x/billing.md:block 619 (paragraph) +#: docs/10.x/billing.md:block 665 (paragraph) msgid "When this method is invoked, a new checkbox will be available to the customer that allows them to indicate if they're purchasing as a company. If so, they will have the opportunity to provide their Tax ID number." msgstr "" -#: docs/10.x/billing.md:block 620 (quote) -msgid "**Warning** If you have already configured [automatic tax collection](#tax-configuration) in your application's service provider then this feature will be enabled automatically and there is no need to invoke the `collectTaxIds` method." +#: docs/10.x/billing.md:block 666 (quote) +msgid "[!WARNING] If you have already configured [automatic tax collection](#tax-configuration) in your application's service provider then this feature will be enabled automatically and there is no need to invoke the `collectTaxIds` method." msgstr "" -#: docs/10.x/billing.md:block 622 (header) +#: docs/10.x/billing.md:block 668 (header) msgid "Guest Checkouts" msgstr "" -#: docs/10.x/billing.md:block 623 (paragraph) +#: docs/10.x/billing.md:block 669 (paragraph) msgid "Using the `Checkout::guest` method, you may initiate checkout sessions for guests of your application that do not have an \"account\":" msgstr "" -#: docs/10.x/billing.md:block 624 (code) +#: docs/10.x/billing.md:block 670 (code) msgid "use Illuminate\\Http\\Request;\n" "use Laravel\\Cashier\\Checkout;\n\n" "Route::get('/product-checkout', function (Request $request) {\n" @@ -2959,11 +3200,11 @@ msgid "use Illuminate\\Http\\Request;\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 625 (paragraph) +#: docs/10.x/billing.md:block 671 (paragraph) msgid "Similarly to when creating checkout sessions for existing users, you may utilize additional methods available on the `Laravel\\Cashier\\CheckoutBuilder` instance to customize the guest checkout session:" msgstr "" -#: docs/10.x/billing.md:block 626 (code) +#: docs/10.x/billing.md:block 672 (code) msgid "use Illuminate\\Http\\Request;\n" "use Laravel\\Cashier\\Checkout;\n\n" "Route::get('/product-checkout', function (Request $request) {\n" @@ -2976,23 +3217,23 @@ msgid "use Illuminate\\Http\\Request;\n" "});\n" msgstr "" -#: docs/10.x/billing.md:block 627 (paragraph) +#: docs/10.x/billing.md:block 673 (paragraph) msgid "After a guest checkout has been completed, Stripe can dispatch a `checkout.session.completed` webhook event, so make sure to [configure your Stripe webhook](https://dashboard.stripe.com/webhooks) to actually send this event to your application. Once the webhook has been enabled within the Stripe dashboard, you may [handle the webhook with Cashier](#handling-stripe-webhooks). The object contained in the webhook payload will be a [`checkout` object](https://stripe.com/docs/api/checkout/sessions/object) that you may inspect in order to fulfill your customer's order." msgstr "" -#: docs/10.x/billing.md:block 629 (header) +#: docs/10.x/billing.md:block 675 (header) msgid "Handling Failed Payments" msgstr "" -#: docs/10.x/billing.md:block 630 (paragraph) +#: docs/10.x/billing.md:block 676 (paragraph) msgid "Sometimes, payments for subscriptions or single charges can fail. When this happens, Cashier will throw an `Laravel\\Cashier\\Exceptions\\IncompletePayment` exception that informs you that this happened. After catching this exception, you have two options on how to proceed." msgstr "" -#: docs/10.x/billing.md:block 631 (paragraph) +#: docs/10.x/billing.md:block 677 (paragraph) msgid "First, you could redirect your customer to the dedicated payment confirmation page which is included with Cashier. This page already has an associated named route that is registered via Cashier's service provider. So, you may catch the `IncompletePayment` exception and redirect the user to the payment confirmation page:" msgstr "" -#: docs/10.x/billing.md:block 632 (code) +#: docs/10.x/billing.md:block 678 (code) msgid "use Laravel\\Cashier\\Exceptions\\IncompletePayment;\n\n" "try {\n" " $subscription = $user->newSubscription('default', 'price_monthly')\n" @@ -3005,59 +3246,59 @@ msgid "use Laravel\\Cashier\\Exceptions\\IncompletePayment;\n\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 633 (paragraph) +#: docs/10.x/billing.md:block 679 (paragraph) msgid "On the payment confirmation page, the customer will be prompted to enter their credit card information again and perform any additional actions required by Stripe, such as \"3D Secure\" confirmation. After confirming their payment, the user will be redirected to the URL provided by the `redirect` parameter specified above. Upon redirection, `message` (string) and `success` (integer) query string variables will be added to the URL. The payment page currently supports the following payment method types:" msgstr "" -#: docs/10.x/billing.md:block 635 (unordered list) +#: docs/10.x/billing.md:block 681 (unordered list) msgid "Credit Cards" msgstr "" -#: docs/10.x/billing.md:block 635 (unordered list) +#: docs/10.x/billing.md:block 681 (unordered list) msgid "Alipay" msgstr "" -#: docs/10.x/billing.md:block 635 (unordered list) +#: docs/10.x/billing.md:block 681 (unordered list) msgid "Bancontact" msgstr "" -#: docs/10.x/billing.md:block 635 (unordered list) +#: docs/10.x/billing.md:block 681 (unordered list) msgid "BECS Direct Debit" msgstr "" -#: docs/10.x/billing.md:block 635 (unordered list) +#: docs/10.x/billing.md:block 681 (unordered list) msgid "EPS" msgstr "" -#: docs/10.x/billing.md:block 635 (unordered list) +#: docs/10.x/billing.md:block 681 (unordered list) msgid "Giropay" msgstr "" -#: docs/10.x/billing.md:block 635 (unordered list) +#: docs/10.x/billing.md:block 681 (unordered list) msgid "iDEAL" msgstr "" -#: docs/10.x/billing.md:block 635 (unordered list) +#: docs/10.x/billing.md:block 681 (unordered list) msgid "SEPA Direct Debit" msgstr "" -#: docs/10.x/billing.md:block 637 (paragraph) +#: docs/10.x/billing.md:block 683 (paragraph) msgid "Alternatively, you could allow Stripe to handle the payment confirmation for you. In this case, instead of redirecting to the payment confirmation page, you may [setup Stripe's automatic billing emails](https://dashboard.stripe.com/account/billing/automatic) in your Stripe dashboard. However, if an `IncompletePayment` exception is caught, you should still inform the user they will receive an email with further payment confirmation instructions." msgstr "" -#: docs/10.x/billing.md:block 638 (paragraph) +#: docs/10.x/billing.md:block 684 (paragraph) msgid "Payment exceptions may be thrown for the following methods: `charge`, `invoiceFor`, and `invoice` on models using the `Billable` trait. When interacting with subscriptions, the `create` method on the `SubscriptionBuilder`, and the `incrementAndInvoice` and `swapAndInvoice` methods on the `Subscription` and `SubscriptionItem` models may throw incomplete payment exceptions." msgstr "" -#: docs/10.x/billing.md:block 639 (paragraph) +#: docs/10.x/billing.md:block 685 (paragraph) msgid "Determining if an existing subscription has an incomplete payment may be accomplished using the `hasIncompletePayment` method on the billable model or a subscription instance:" msgstr "" -#: docs/10.x/billing.md:block 641 (paragraph) +#: docs/10.x/billing.md:block 687 (paragraph) msgid "You can derive the specific status of an incomplete payment by inspecting the `payment` property on the exception instance:" msgstr "" -#: docs/10.x/billing.md:block 642 (code) +#: docs/10.x/billing.md:block 688 (code) msgid "use Laravel\\Cashier\\Exceptions\\IncompletePayment;\n\n" "try {\n" " $user->charge(1000, 'pm_card_threeDSecure2Required');\n" @@ -3073,137 +3314,187 @@ msgid "use Laravel\\Cashier\\Exceptions\\IncompletePayment;\n\n" "}\n" msgstr "" -#: docs/10.x/billing.md:block 644 (header) +#: docs/10.x/billing.md:block 690 (header) msgid "Confirming Payments" msgstr "" -#: docs/10.x/billing.md:block 645 (paragraph) +#: docs/10.x/billing.md:block 691 (paragraph) msgid "Some payment methods require additional data in order to confirm payments. For example, SEPA payment methods require additional \"mandate\" data during the payment process. You may provide this data to Cashier using the `withPaymentConfirmationOptions` method:" msgstr "" -#: docs/10.x/billing.md:block 646 (code) +#: docs/10.x/billing.md:block 692 (code) msgid "$subscription->withPaymentConfirmationOptions([\n" " 'mandate_data' => '...',\n" "])->swap('price_xxx');\n" msgstr "" -#: docs/10.x/billing.md:block 647 (paragraph) +#: docs/10.x/billing.md:block 693 (paragraph) msgid "You may consult the [Stripe API documentation](https://stripe.com/docs/api/payment_intents/confirm) to review all of the options accepted when confirming payments." msgstr "" -#: docs/10.x/billing.md:block 649 (header) +#: docs/10.x/billing.md:block 695 (header) msgid "Strong Customer Authentication" msgstr "" -#: docs/10.x/billing.md:block 650 (paragraph) +#: docs/10.x/billing.md:block 696 (paragraph) msgid "If your business or one of your customers is based in Europe you will need to abide by the EU's Strong Customer Authentication (SCA) regulations. These regulations were imposed in September 2019 by the European Union to prevent payment fraud. Luckily, Stripe and Cashier are prepared for building SCA compliant applications." msgstr "" -#: docs/10.x/billing.md:block 651 (quote) -msgid "**Warning** Before getting started, review [Stripe's guide on PSD2 and SCA](https://stripe.com/guides/strong-customer-authentication) as well as their [documentation on the new SCA APIs](https://stripe.com/docs/strong-customer-authentication)." +#: docs/10.x/billing.md:block 697 (quote) +msgid "[!WARNING] Before getting started, review [Stripe's guide on PSD2 and SCA](https://stripe.com/guides/strong-customer-authentication) as well as their [documentation on the new SCA APIs](https://stripe.com/docs/strong-customer-authentication)." msgstr "" -#: docs/10.x/billing.md:block 653 (header) +#: docs/10.x/billing.md:block 699 (header) msgid "Payments Requiring Additional Confirmation" msgstr "" -#: docs/10.x/billing.md:block 654 (paragraph) +#: docs/10.x/billing.md:block 700 (paragraph) msgid "SCA regulations often require extra verification in order to confirm and process a payment. When this happens, Cashier will throw a `Laravel\\Cashier\\Exceptions\\IncompletePayment` exception that informs you that extra verification is needed. More information on how to handle these exceptions be found can be found in the documentation on [handling failed payments](#handling-failed-payments)." msgstr "" -#: docs/10.x/billing.md:block 655 (paragraph) +#: docs/10.x/billing.md:block 701 (paragraph) msgid "Payment confirmation screens presented by Stripe or Cashier may be tailored to a specific bank or card issuer's payment flow and can include additional card confirmation, a temporary small charge, separate device authentication, or other forms of verification." msgstr "" -#: docs/10.x/billing.md:block 657 (header) +#: docs/10.x/billing.md:block 703 (header) msgid "Incomplete and Past Due State" msgstr "" -#: docs/10.x/billing.md:block 658 (paragraph) +#: docs/10.x/billing.md:block 704 (paragraph) msgid "When a payment needs additional confirmation, the subscription will remain in an `incomplete` or `past_due` state as indicated by its `stripe_status` database column. Cashier will automatically activate the customer's subscription as soon as payment confirmation is complete and your application is notified by Stripe via webhook of its completion." msgstr "" -#: docs/10.x/billing.md:block 659 (paragraph) +#: docs/10.x/billing.md:block 705 (paragraph) msgid "For more information on `incomplete` and `past_due` states, please refer to [our additional documentation on these states](#incomplete-and-past-due-status)." msgstr "" -#: docs/10.x/billing.md:block 661 (header) +#: docs/10.x/billing.md:block 707 (header) msgid "Off-Session Payment Notifications" msgstr "" -#: docs/10.x/billing.md:block 662 (paragraph) +#: docs/10.x/billing.md:block 708 (paragraph) msgid "Since SCA regulations require customers to occasionally verify their payment details even while their subscription is active, Cashier can send a notification to the customer when off-session payment confirmation is required. For example, this may occur when a subscription is renewing. Cashier's payment notification can be enabled by setting the `CASHIER_PAYMENT_NOTIFICATION` environment variable to a notification class. By default, this notification is disabled. Of course, Cashier includes a notification class you may use for this purpose, but you are free to provide your own notification class if desired:" msgstr "" -#: docs/10.x/billing.md:block 663 (code) +#: docs/10.x/billing.md:block 709 (code) msgid "CASHIER_PAYMENT_NOTIFICATION=Laravel\\Cashier\\Notifications\\ConfirmPayment\n" msgstr "" -#: docs/10.x/billing.md:block 664 (paragraph) +#: docs/10.x/billing.md:block 710 (paragraph) msgid "To ensure that off-session payment confirmation notifications are delivered, verify that [Stripe webhooks are configured](#handling-stripe-webhooks) for your application and the `invoice.payment_action_required` webhook is enabled in your Stripe dashboard. In addition, your `Billable` model should also use Laravel's `Illuminate\\Notifications\\Notifiable` trait." msgstr "" -#: docs/10.x/billing.md:block 665 (quote) -msgid "**Warning** Notifications will be sent even when customers are manually making a payment that requires additional confirmation. Unfortunately, there is no way for Stripe to know that the payment was done manually or \"off-session\". But, a customer will simply see a \"Payment Successful\" message if they visit the payment page after already confirming their payment. The customer will not be allowed to accidentally confirm the same payment twice and incur an accidental second charge." +#: docs/10.x/billing.md:block 711 (quote) +msgid "[!WARNING] Notifications will be sent even when customers are manually making a payment that requires additional confirmation. Unfortunately, there is no way for Stripe to know that the payment was done manually or \"off-session\". But, a customer will simply see a \"Payment Successful\" message if they visit the payment page after already confirming their payment. The customer will not be allowed to accidentally confirm the same payment twice and incur an accidental second charge." msgstr "" -#: docs/10.x/billing.md:block 667 (header) +#: docs/10.x/billing.md:block 713 (header) msgid "Stripe SDK" msgstr "" -#: docs/10.x/billing.md:block 668 (paragraph) +#: docs/10.x/billing.md:block 714 (paragraph) msgid "Many of Cashier's objects are wrappers around Stripe SDK objects. If you would like to interact with the Stripe objects directly, you may conveniently retrieve them using the `asStripe` method:" msgstr "" -#: docs/10.x/billing.md:block 669 (code) +#: docs/10.x/billing.md:block 715 (code) msgid "$stripeSubscription = $subscription->asStripeSubscription();\n\n" "$stripeSubscription->application_fee_percent = 5;\n\n" "$stripeSubscription->save();\n" msgstr "" -#: docs/10.x/billing.md:block 670 (paragraph) +#: docs/10.x/billing.md:block 716 (paragraph) msgid "You may also use the `updateStripeSubscription` method to update a Stripe subscription directly:" msgstr "" -#: docs/10.x/billing.md:block 671 (code) +#: docs/10.x/billing.md:block 717 (code) msgid "$subscription->updateStripeSubscription(['application_fee_percent' => 5]);\n" msgstr "" -#: docs/10.x/billing.md:block 672 (paragraph) +#: docs/10.x/billing.md:block 718 (paragraph) msgid "You may invoke the `stripe` method on the `Cashier` class if you would like to use the `Stripe\\StripeClient` client directly. For example, you could use this method to access the `StripeClient` instance and retrieve a list of prices from your Stripe account:" msgstr "" -#: docs/10.x/billing.md:block 673 (code) +#: docs/10.x/billing.md:block 719 (code) msgid "use Laravel\\Cashier\\Cashier;\n\n" "$prices = Cashier::stripe()->prices->all();\n" msgstr "" -#: docs/10.x/billing.md:block 675 (header) +#: docs/10.x/billing.md:block 721 (header) msgid "Testing" msgstr "" -#: docs/10.x/billing.md:block 676 (paragraph) +#: docs/10.x/billing.md:block 722 (paragraph) msgid "When testing an application that uses Cashier, you may mock the actual HTTP requests to the Stripe API; however, this requires you to partially re-implement Cashier's own behavior. Therefore, we recommend allowing your tests to hit the actual Stripe API. While this is slower, it provides more confidence that your application is working as expected and any slow tests may be placed within their own PHPUnit testing group." msgstr "" -#: docs/10.x/billing.md:block 677 (paragraph) +#: docs/10.x/billing.md:block 723 (paragraph) msgid "When testing, remember that Cashier itself already has a great test suite, so you should only focus on testing the subscription and payment flow of your own application and not every underlying Cashier behavior." msgstr "" -#: docs/10.x/billing.md:block 678 (paragraph) +#: docs/10.x/billing.md:block 724 (paragraph) msgid "To get started, add the **testing** version of your Stripe secret to your `phpunit.xml` file:" msgstr "" -#: docs/10.x/billing.md:block 679 (code) +#: docs/10.x/billing.md:block 725 (code) msgid "\"/>\n" msgstr "" -#: docs/10.x/billing.md:block 680 (paragraph) +#: docs/10.x/billing.md:block 726 (paragraph) msgid "Now, whenever you interact with Cashier while testing, it will send actual API requests to your Stripe testing environment. For convenience, you should pre-fill your Stripe testing account with subscriptions / prices that you may use during testing." msgstr "" -#: docs/10.x/billing.md:block 681 (quote) -msgid "**Note** In order to test a variety of billing scenarios, such as credit card denials and failures, you may use the vast range of [testing card numbers and tokens](https://stripe.com/docs/testing) provided by Stripe." +#: docs/10.x/billing.md:block 727 (quote) +msgid "[!NOTE] In order to test a variety of billing scenarios, such as credit card denials and failures, you may use the vast range of [testing card numbers and tokens](https://stripe.com/docs/testing) provided by Stripe." +msgstr "" + +#: docs/11.x/billing.md:block 69 (code) +msgid "use Illuminate\\Http\\Request;\n\n" +"Route::get('/checkout', function (Request $request) {\n" +" $stripePriceId = 'price_deluxe_album';\n\n" +" $quantity = 1;\n\n" +" return $request->user()->checkout([$stripePriceId => $quantity], [\n" +" 'success_url' => route('checkout-success'),\n" +" 'cancel_url' => route('checkout-cancel'),\n" +" ]);\n" +"})->name('checkout');\n\n" +"Route::view('/checkout/success', 'checkout.success')->name('checkout-success');\n" +"Route::view('/checkout/cancel', 'checkout.cancel')->name('checkout-cancel');\n" +msgstr "" + +#: docs/11.x/billing.md:block 106 (quote) +msgid "[!NOTE] As long as you have configured Cashier's webhook handling, Cashier will automatically keep your application's Cashier-related database tables in sync by inspecting the incoming webhooks from Stripe. So, for example, when a user cancels their subscription via Stripe's Customer Billing Portal, Cashier will receive the corresponding webhook and mark the subscription as \"canceled\" in your application's database." +msgstr "" + +#: docs/11.x/billing.md:block 246 (paragraph) +msgid "The amount of time a customer has to pay their invoice before their subscription is canceled is determined by the `days_until_due` option. By default, this is 30 days; however, you may provide a specific value for this option if you wish:" +msgstr "" + +#: docs/11.x/billing.md:block 528 (paragraph) +msgid "Since Stripe webhooks need to bypass Laravel's [CSRF protection](/docs/{{version}}/csrf), you should ensure that Laravel does not attempt to validate the CSRF token for incoming Stripe webhooks. To accomplish this, you should exclude `stripe/*` from CSRF protection in your application's `bootstrap/app.php` file:" +msgstr "" + +#: docs/11.x/billing.md:block 529 (code) +msgid "->withMiddleware(function (Middleware $middleware) {\n" +" $middleware->validateCsrfTokens(except: [\n" +" 'stripe/*',\n" +" ]);\n" +"})\n" +msgstr "" + +#: docs/11.x/billing.md:block 720 (paragraph) +msgid "When testing an application that uses Cashier, you may mock the actual HTTP requests to the Stripe API; however, this requires you to partially re-implement Cashier's own behavior. Therefore, we recommend allowing your tests to hit the actual Stripe API. While this is slower, it provides more confidence that your application is working as expected and any slow tests may be placed within their own Pest / PHPUnit testing group." +msgstr "" + +#: docs/8.x/billing.md:block 2 (unordered list) +msgid "[Database Migrations](#database-migrations)" +msgstr "" + +#: docs/8.x/billing.md:block 2 (unordered list) +msgid "[Determining If A User Has A Payment Method](#check-for-a-payment-method)" +msgstr "" + +#: docs/8.x/billing.md:block 2 (unordered list) +msgid "[Updating The Default Payment Method](#updating-the-default-payment-method)" msgstr "" #: docs/8.x/billing.md:block 2 (unordered list) @@ -3218,10 +3509,22 @@ msgstr "" msgid "{note} To ensure Cashier properly handles all Stripe events, remember to [set up Cashier's webhook handling](#handling-stripe-webhooks)." msgstr "" +#: docs/8.x/billing.md:block 16 (header) +msgid "Database Migrations" +msgstr "" + #: docs/8.x/billing.md:block 17 (paragraph) msgid "Cashier's service provider registers its own database migration directory, so remember to migrate your database after installing the package. The Cashier migrations will add several columns to your `users` table as well as create a new `subscriptions` table to hold all of your customer's subscriptions:" msgstr "" +#: docs/8.x/billing.md:block 19 (paragraph) +msgid "If you need to overwrite the migrations that ship with Cashier, you can publish them using the `vendor:publish` Artisan command:" +msgstr "" + +#: docs/8.x/billing.md:block 21 (paragraph) +msgid "If you would like to prevent Cashier's migrations from running entirely, you may use the `ignoreMigrations` method provided by Cashier. Typically, this method should be called in the `register` method of your `AppServiceProvider`:" +msgstr "" + #: docs/8.x/billing.md:block 22 (code) msgid "use Laravel\\Cashier\\Cashier;\n\n" "/**\n" @@ -3351,10 +3654,26 @@ msgstr "" msgid "In order to create subscriptions or perform \"one off\" charges with Stripe, you will need to store a payment method and retrieve its identifier from Stripe. The approach used to accomplish this differs based on whether you plan to use the payment method for subscriptions or single charges, so we will examine both below." msgstr "" +#: docs/8.x/billing.md:block 126 (header) +msgid "Payment Methods For Subscriptions" +msgstr "" + #: docs/8.x/billing.md:block 136 (quote) msgid "{tip} If you would like more information about Setup Intents and gathering customer payment details please [review this overview provided by Stripe](https://stripe.com/docs/payments/save-and-reuse#php)." msgstr "" +#: docs/8.x/billing.md:block 138 (header) +msgid "Payment Methods For Single Charges" +msgstr "" + +#: docs/8.x/billing.md:block 150 (paragraph) +msgid "By default, this method will return payment methods of the `card` type. To retrieve payment methods of a different type, you may pass the `type` as an argument to the method:" +msgstr "" + +#: docs/8.x/billing.md:block 157 (header) +msgid "Determining If A User Has A Payment Method" +msgstr "" + #: docs/8.x/billing.md:block 159 (code) msgid "if ($user->hasDefaultPaymentMethod()) {\n" " //\n" @@ -3367,12 +3686,20 @@ msgid "if ($user->hasPaymentMethod()) {\n" "}\n" msgstr "" +#: docs/8.x/billing.md:block 162 (paragraph) +msgid "This method will determine if the billable model has payment methods of the `card` type. To determine if a payment method of another type exists for the model, you may pass the `type` as an argument to the method:" +msgstr "" + #: docs/8.x/billing.md:block 163 (code) msgid "if ($user->hasPaymentMethod('sepa_debit')) {\n" " //\n" "}\n" msgstr "" +#: docs/8.x/billing.md:block 165 (header) +msgid "Updating The Default Payment Method" +msgstr "" + #: docs/8.x/billing.md:block 170 (quote) msgid "{note} The default payment method on a customer can only be used for invoicing and creating new subscriptions. Due to limitations imposed by Stripe, it may not be used for single charges." msgstr "" @@ -3381,14 +3708,26 @@ msgstr "" msgid "{tip} To learn how to retrieve payment method identifiers please review the [payment method storage documentation](#storing-payment-methods)." msgstr "" +#: docs/8.x/billing.md:block 184 (paragraph) +msgid "By default, this method will delete payment methods of the `card` type. To delete payment methods of a different type you can pass the `type` as an argument to the method:" +msgstr "" + #: docs/8.x/billing.md:block 186 (quote) msgid "{note} If a user has an active subscription, your application should not allow them to delete their default payment method." msgstr "" +#: docs/8.x/billing.md:block 194 (paragraph) +msgid "The first argument passed to the `newSubscription` method should be the internal name of the subscription. If your application only offers a single subscription, you might call this `default` or `primary`. This subscription name is only for internal application usage and is not meant to be shown to users. In addition, it should not contain spaces and it should never be changed after creating the subscription. The second argument is the specific price the user is subscribing to. This value should correspond to the price's identifier in Stripe." +msgstr "" + #: docs/8.x/billing.md:block 196 (quote) msgid "{note} Passing a payment method identifier directly to the `create` subscription method will also automatically add it to the user's stored payment methods." msgstr "" +#: docs/8.x/billing.md:block 198 (header) +msgid "Collecting Recurring Payments Via Invoice Emails" +msgstr "" + #: docs/8.x/billing.md:block 201 (paragraph) msgid "The amount of time a customer has to pay their invoice before their subscription is canceled is determined by your subscription and invoice settings within the [Stripe dashboard](https://dashboard.stripe.com/settings/billing/automatic)." msgstr "" @@ -3403,14 +3742,26 @@ msgid "$user->newSubscription('default', 'price_monthly')\n" " ->create($paymentMethod);\n" msgstr "" +#: docs/8.x/billing.md:block 221 (header) +msgid "Creating Subscriptions From The Stripe Dashboard" +msgstr "" + #: docs/8.x/billing.md:block 222 (paragraph) msgid "You may also create subscriptions from the Stripe dashboard itself. When doing so, Cashier will sync newly added subscriptions and assign them a name of `default`. To customize the subscription name that is assigned to dashboard created subscriptions, [extend the `WebhookController`](/docs/{{version}}/billing#defining-webhook-event-handlers) and overwrite the `newSubscriptionName` method." msgstr "" +#: docs/8.x/billing.md:block 223 (paragraph) +msgid "In addition, you may only create one type of subscription via the Stripe dashboard. If your application offers multiple subscriptions that use different names, only one type of subscription may be added through the Stripe dashboard." +msgstr "" + #: docs/8.x/billing.md:block 224 (paragraph) msgid "Finally, you should always make sure to only add one active subscription per type of subscription offered by your application. If customer has two `default` subscriptions, only the most recently added subscription will be used by Cashier even though both would be synced with your application's database." msgstr "" +#: docs/8.x/billing.md:block 227 (paragraph) +msgid "Once a customer is subscribed to your application, you may easily check their subscription status using a variety of convenient methods. First, the `subscribed` method returns `true` if the customer has an active subscription, even if the subscription is currently within its trial period. The `subscribed` method accepts the name of the subscription as its first argument:" +msgstr "" + #: docs/8.x/billing.md:block 228 (code) msgid "if ($user->subscribed('default')) {\n" " //\n" @@ -3559,6 +3910,10 @@ msgstr "" msgid "By default, Stripe will prorate charges when adding or removing prices from a multiprice subscription. If you would like to make a price adjustment without proration, you should chain the `noProrate` method onto your price operation:" msgstr "" +#: docs/8.x/billing.md:block 325 (paragraph) +msgid "If you would like to update quantities on individual subscription prices, you may do so using the [existing quantity methods](#subscription-quantity) by passing the name of the price as an additional argument to the method:" +msgstr "" + #: docs/8.x/billing.md:block 327 (quote) msgid "{note} When a subscription has multiple prices the `stripe_price` and `quantity` attributes on the `Subscription` model will be `null`. To access the individual price attributes, you should use the `items` relationship available on the `Subscription` model." msgstr "" @@ -3622,10 +3977,18 @@ msgid "if ($user->onTrial('default')) {\n" "}\n" msgstr "" +#: docs/8.x/billing.md:block 418 (header) +msgid "Defining Trial Days In Stripe / Cashier" +msgstr "" + #: docs/8.x/billing.md:block 424 (quote) msgid "{note} Be sure to add a [date cast](/docs/{{version}}/eloquent-mutators##date-casting) for the `trial_ends_at` attribute within your billable model's class definition." msgstr "" +#: docs/8.x/billing.md:block 429 (paragraph) +msgid "To retrieve the user's trial ending date, you may use the `trialEndsAt` method. This method will return a Carbon date instance if a user is on a trial or `null` if they aren't. You may also pass an optional subscription name parameter if you would like to get the trial ending date for a specific subscription other than the default one:" +msgstr "" + #: docs/8.x/billing.md:block 439 (quote) msgid "{tip} You may use [the Stripe CLI](https://stripe.com/docs/stripe-cli) to help test webhooks during local development." msgstr "" @@ -3634,6 +3997,10 @@ msgstr "" msgid "{note} Make sure you protect incoming Stripe webhook requests with Cashier's included [webhook signature verification](#verifying-webhook-signatures) middleware." msgstr "" +#: docs/8.x/billing.md:block 454 (header) +msgid "Webhooks & CSRF Protection" +msgstr "" + #: docs/8.x/billing.md:block 462 (code) msgid "hasExpiredTrial('default')) {\n" " //\n" @@ -3799,6 +4274,30 @@ msgid "if ($user->hasExpiredTrial('default')) {\n" "}\n" msgstr "" +#: docs/9.x/billing.md:block 451 (quote) +msgid "**Warning** Be sure to add a [date cast](/docs/{{version}}/eloquent-mutators#date-casting) for the `trial_ends_at` attribute within your billable model's class definition." +msgstr "" + +#: docs/9.x/billing.md:block 466 (quote) +msgid "**Note** You may use [the Stripe CLI](https://stripe.com/docs/stripe-cli) to help test webhooks during local development." +msgstr "" + +#: docs/9.x/billing.md:block 479 (quote) +msgid "**Warning** Make sure you protect incoming Stripe webhook requests with Cashier's included [webhook signature verification](#verifying-webhook-signatures) middleware." +msgstr "" + +#: docs/9.x/billing.md:block 508 (quote) +msgid "**Warning** The `charge` method accepts the payment amount in the lowest denominator of the currency used by your application. For example, if customers are paying in United States Dollars, amounts should be specified in pennies." +msgstr "" + +#: docs/9.x/billing.md:block 520 (quote) +msgid "**Warning** The `invoice`, `invoicePrice`, and `invoiceFor` methods will create a Stripe invoice which will retry failed billing attempts. If you do not want invoices to retry failed charges, you will need to close them using the Stripe API after the first failed charge." +msgstr "" + +#: docs/9.x/billing.md:block 528 (quote) +msgid "**Warning** The `pay` and `payWith` methods accept the payment amount in the lowest denominator of the currency used by your application. For example, if customers are paying in United States Dollars, amounts should be specified in pennies." +msgstr "" + #: docs/9.x/billing.md:block 564 (code) msgid "use Illuminate\\Http\\Request;\n\n" "Route::get('/user/invoice/{invoice}', function (Request $request, $invoiceId) {\n" @@ -3806,3 +4305,31 @@ msgid "use Illuminate\\Http\\Request;\n\n" "});\n" msgstr "" +#: docs/9.x/billing.md:block 596 (quote) +msgid "**Warning** When using the `checkoutCharge` method, Stripe will always create a new product and price in your Stripe dashboard. Therefore, we recommend that you create the products up front in your Stripe dashboard and use the `checkout` method instead." +msgstr "" + +#: docs/9.x/billing.md:block 599 (quote) +msgid "**Warning** Using Stripe Checkout for subscriptions requires you to enable the `customer.subscription.created` webhook in your Stripe dashboard. This webhook will create the subscription record in your database and store all of the relevant subscription items." +msgstr "" + +#: docs/9.x/billing.md:block 606 (quote) +msgid "**Warning** Unfortunately Stripe Checkout does not support all subscription billing options when starting subscriptions. Using the `anchorBillingCycleOn` method on the subscription builder, setting proration behavior, or setting payment behavior will not have any effect during Stripe Checkout sessions. Please consult [the Stripe Checkout Session API documentation](https://stripe.com/docs/api/checkout/sessions/create) to review which parameters are available." +msgstr "" + +#: docs/9.x/billing.md:block 620 (quote) +msgid "**Warning** If you have already configured [automatic tax collection](#tax-configuration) in your application's service provider then this feature will be enabled automatically and there is no need to invoke the `collectTaxIds` method." +msgstr "" + +#: docs/9.x/billing.md:block 646 (quote) +msgid "**Warning** Before getting started, review [Stripe's guide on PSD2 and SCA](https://stripe.com/guides/strong-customer-authentication) as well as their [documentation on the new SCA APIs](https://stripe.com/docs/strong-customer-authentication)." +msgstr "" + +#: docs/9.x/billing.md:block 660 (quote) +msgid "**Warning** Notifications will be sent even when customers are manually making a payment that requires additional confirmation. Unfortunately, there is no way for Stripe to know that the payment was done manually or \"off-session\". But, a customer will simply see a \"Payment Successful\" message if they visit the payment page after already confirming their payment. The customer will not be allowed to accidentally confirm the same payment twice and incur an accidental second charge." +msgstr "" + +#: docs/9.x/billing.md:block 676 (quote) +msgid "**Note** In order to test a variety of billing scenarios, such as credit card denials and failures, you may use the vast range of [testing card numbers and tokens](https://stripe.com/docs/testing) provided by Stripe." +msgstr "" + From 95e9bc90f7e78f8e8d1dbbc2b65a94049a51dc70 Mon Sep 17 00:00:00 2001 From: Cornch Date: Sun, 30 Jun 2024 17:00:33 +0800 Subject: [PATCH 005/491] New translations blade.pot (Chinese Traditional) --- po/zh_TW/blade.po | 961 +++++++++++++++++++++++++++------------------- 1 file changed, 557 insertions(+), 404 deletions(-) diff --git a/po/zh_TW/blade.po b/po/zh_TW/blade.po index 113552319..6f66260b7 100644 --- a/po/zh_TW/blade.po +++ b/po/zh_TW/blade.po @@ -10,7 +10,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Language-Team: Chinese Traditional\n" "Language: zh_TW\n" -"PO-Revision-Date: 2024-06-30 08:17\n" +"PO-Revision-Date: 2024-06-30 09:00\n" #: docs/10.x/blade.md:block 1 (header) msgid "Blade Templates" @@ -33,8 +33,8 @@ msgid "[HTML Entity Encoding](#html-entity-encoding)" msgstr "[HTML 實體編碼](#html-entity-encoding)" #: docs/10.x/blade.md:block 2 (unordered list) -msgid "[Blade & JavaScript Frameworks](#blade-and-javascript-frameworks)" -msgstr "[Blade 與 JavaScript 框架](#blade-and-javascript-frameworks)" +msgid "[Blade and JavaScript Frameworks](#blade-and-javascript-frameworks)" +msgstr "" #: docs/10.x/blade.md:block 2 (unordered list) msgid "[Blade Directives](#blade-directives)" @@ -89,8 +89,8 @@ msgid "[Rendering Components](#rendering-components)" msgstr "[轉譯元件](#rendering-components)" #: docs/10.x/blade.md:block 2 (unordered list) -msgid "[Passing Data To Components](#passing-data-to-components)" -msgstr "[將資料傳給元件](#passing-data-to-components)" +msgid "[Passing Data to Components](#passing-data-to-components)" +msgstr "" #: docs/10.x/blade.md:block 2 (unordered list) msgid "[Component Attributes](#component-attributes)" @@ -245,8 +245,8 @@ msgid "Hello, {{ $name }}.\n" msgstr "Hello, {{ $name }}.\n" #: docs/10.x/blade.md:block 17 (quote) -msgid "**Note** Blade's `{{ }}` echo statements are automatically sent through PHP's `htmlspecialchars` function to prevent XSS attacks." -msgstr "**Note** Blade 的 `{{ }}` echo 陳述式會自動通過 PHP 的 `htmlspecialchars` 函式來防止 XSS 攻擊。" +msgid "[!NOTE] Blade's `{{ }}` echo statements are automatically sent through PHP's `htmlspecialchars` function to prevent XSS attacks." +msgstr "" #: docs/10.x/blade.md:block 18 (paragraph) msgid "You are not limited to displaying the contents of the variables passed to the view. You may also echo the results of any PHP function. In fact, you can put any PHP code you wish inside of a Blade echo statement:" @@ -307,12 +307,12 @@ msgid "Hello, {!! $name !!}.\n" msgstr "Hello, {!! $name !!}.\n" #: docs/10.x/blade.md:block 28 (quote) -msgid "**Warning** Be very careful when echoing content that is supplied by users of your application. You should typically use the escaped, double curly brace syntax to prevent XSS attacks when displaying user supplied data." -msgstr "**Warning** 在輸出使用者提供的資料時,請格外小心。平常在顯示使用者提供的資料時應該要使用經過逸出的雙大括號語法來防止 XSS 攻擊。" +msgid "[!WARNING] Be very careful when echoing content that is supplied by users of your application. You should typically use the escaped, double curly brace syntax to prevent XSS attacks when displaying user supplied data." +msgstr "" #: docs/10.x/blade.md:block 30 (header) -msgid "Blade & JavaScript Frameworks" -msgstr "Blade 與 JavaScript 框架" +msgid "Blade and JavaScript Frameworks" +msgstr "" #: docs/10.x/blade.md:block 31 (paragraph) msgid "Since many JavaScript frameworks also use \"curly\" braces to indicate a given expression should be displayed in the browser, you may use the `@` symbol to inform the Blade rendering engine an expression should remain untouched. For example:" @@ -383,8 +383,8 @@ msgstr "\n" #: docs/10.x/blade.md:block 44 (quote) -msgid "**Warning** You should only use the `Js::from` method to render existing variables as JSON. The Blade templating is based on regular expressions and attempts to pass a complex expression to the directive may cause unexpected failures." -msgstr "**Warning** 請只在轉譯現有變數為 JSON 時使用 `Js::from` 方法。Blade 樣板引擎是是基於正規標示式實作的,若將複雜的陳述式傳給指示詞可能會導致未預期的錯誤。" +msgid "[!WARNING] You should only use the `Js::from` method to render existing variables as JSON. The Blade templating is based on regular expressions and attempts to pass a complex expression to the directive may cause unexpected failures." +msgstr "" #: docs/10.x/blade.md:block 46 (header) msgid "The `@verbatim` Directive" @@ -581,14 +581,30 @@ msgstr "@sectionMissing('navigation')\n" "@endif\n" #: docs/10.x/blade.md:block 79 (header) +msgid "Session Directives" +msgstr "" + +#: docs/10.x/blade.md:block 80 (paragraph) +msgid "The `@session` directive may be used to determine if a [session](/docs/{{version}}/session) value exists. If the session value exists, the template contents within the `@session` and `@endsession` directives will be evaluated. Within the `@session` directive's contents, you may echo the `$value` variable to display the session value:" +msgstr "" + +#: docs/10.x/blade.md:block 81 (code) +msgid "@session('status')\n" +"
\n" +" {{ $value }}\n" +"
\n" +"@endsession\n" +msgstr "" + +#: docs/10.x/blade.md:block 83 (header) msgid "Switch Statements" msgstr "Switch 陳述式" -#: docs/10.x/blade.md:block 80 (paragraph) +#: docs/10.x/blade.md:block 84 (paragraph) msgid "Switch statements can be constructed using the `@switch`, `@case`, `@break`, `@default` and `@endswitch` directives:" msgstr "Switch 陳述式可以通過 `@switch`, `@case`, `@break`, `@default` 與 `@endswitch` 指示詞來架構:" -#: docs/10.x/blade.md:block 81 (code) +#: docs/10.x/blade.md:block 85 (code) msgid "@switch($i)\n" " @case(1)\n" " First case...\n" @@ -610,15 +626,15 @@ msgstr "@switch($i)\n" " Default case...\n" "@endswitch\n" -#: docs/10.x/blade.md:block 83 (header) +#: docs/10.x/blade.md:block 87 (header) msgid "Loops" msgstr "迴圈" -#: docs/10.x/blade.md:block 84 (paragraph) +#: docs/10.x/blade.md:block 88 (paragraph) msgid "In addition to conditional statements, Blade provides simple directives for working with PHP's loop structures. Again, each of these directives functions identically to their PHP counterparts:" msgstr "除了條件陳述式外,Blade 也提供了能配合 PHP 的迴圈架構一起使用的一些簡單指示詞。同樣地,這些指示詞的功能都與其對應 PHP 的部分相同:" -#: docs/10.x/blade.md:block 85 (code) +#: docs/10.x/blade.md:block 89 (code) msgid "@for ($i = 0; $i < 10; $i++)\n" " The current value is {{ $i }}\n" "@endfor\n\n" @@ -648,15 +664,15 @@ msgstr "@for ($i = 0; $i < 10; $i++)\n" "

我會無限循環。

\n" "@endwhile\n" -#: docs/10.x/blade.md:block 86 (quote) -msgid "**Note** While iterating through a `foreach` loop, you may use the [loop variable](#the-loop-variable) to gain valuable information about the loop, such as whether you are in the first or last iteration through the loop." -msgstr "**Note** 在使用 `foreach` 迴圈迭代時,可以使用[迴圈變數](#the-loop-variable)來取得有關迴圈的有用資訊,如目前是否在迴圈的第一次或最後一次迭代。" +#: docs/10.x/blade.md:block 90 (quote) +msgid "[!NOTE] While iterating through a `foreach` loop, you may use the [loop variable](#the-loop-variable) to gain valuable information about the loop, such as whether you are in the first or last iteration through the loop." +msgstr "" -#: docs/10.x/blade.md:block 87 (paragraph) +#: docs/10.x/blade.md:block 91 (paragraph) msgid "When using loops you may also skip the current iteration or end the loop using the `@continue` and `@break` directives:" msgstr "在使用迴圈時,我們可以使用 `@continue` 與 `@break` 指示詞來跳過目前的迭代或終止迴圈:" -#: docs/10.x/blade.md:block 88 (code) +#: docs/10.x/blade.md:block 92 (code) msgid "@foreach ($users as $user)\n" " @if ($user->type == 1)\n" " @continue\n" @@ -676,11 +692,11 @@ msgstr "@foreach ($users as $user)\n" " @endif\n" "@endforeach\n" -#: docs/10.x/blade.md:block 89 (paragraph) +#: docs/10.x/blade.md:block 93 (paragraph) msgid "You may also include the continuation or break condition within the directive declaration:" msgstr "也可以在指示詞定義中包含 continue 或 break 的條件:" -#: docs/10.x/blade.md:block 90 (code) +#: docs/10.x/blade.md:block 94 (code) msgid "@foreach ($users as $user)\n" " @continue($user->type == 1)\n\n" "
  • {{ $user->name }}
  • \n\n" @@ -692,15 +708,15 @@ msgstr "@foreach ($users as $user)\n" " @break($user->number == 5)\n" "@endforeach\n" -#: docs/10.x/blade.md:block 92 (header) +#: docs/10.x/blade.md:block 96 (header) msgid "The Loop Variable" msgstr "迴圈變數" -#: docs/10.x/blade.md:block 93 (paragraph) +#: docs/10.x/blade.md:block 97 (paragraph) msgid "While iterating through a `foreach` loop, a `$loop` variable will be available inside of your loop. This variable provides access to some useful bits of information such as the current loop index and whether this is the first or last iteration through the loop:" msgstr "在迭代 `foreach` 迴圈時,迴圈內提供了 `$loop` 變數可用。這個變數提供了許多實用的資訊,如目前的迴圈索引,以及本次迭代是否為迴圈的第一次或最後一次迭代:" -#: docs/10.x/blade.md:block 94 (code) +#: docs/10.x/blade.md:block 98 (code) msgid "@foreach ($users as $user)\n" " @if ($loop->first)\n" " This is the first iteration.\n" @@ -720,11 +736,11 @@ msgstr "@foreach ($users as $user)\n" "

    使用者 {{ $user->id }}

    \n" "@endforeach\n" -#: docs/10.x/blade.md:block 95 (paragraph) +#: docs/10.x/blade.md:block 99 (paragraph) msgid "If you are in a nested loop, you may access the parent loop's `$loop` variable via the `parent` property:" msgstr "若在巢狀迴圈中,可以通過 `parent` 屬性來存取上層迴圈的 `$loop` 變數:" -#: docs/10.x/blade.md:block 96 (code) +#: docs/10.x/blade.md:block 100 (code) msgid "@foreach ($users as $user)\n" " @foreach ($user->posts as $post)\n" " @if ($loop->parent->first)\n" @@ -740,107 +756,107 @@ msgstr "@foreach ($users as $user)\n" " @endforeach\n" "@endforeach\n" -#: docs/10.x/blade.md:block 97 (paragraph) +#: docs/10.x/blade.md:block 101 (paragraph) msgid "The `$loop` variable also contains a variety of other useful properties:" msgstr "`$loop` 變數也包含了其他各種實用的屬性:" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "Property" msgstr "屬性" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "Description" msgstr "說明" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "`$loop->index`" msgstr "`$loop->index`" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "The index of the current loop iteration (starts at 0)." msgstr "目前迴圈迭代的索引 (從 0 開始)。" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "`$loop->iteration`" msgstr "`$loop->iteration`" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "The current loop iteration (starts at 1)." msgstr "目前的迴圈迭代 (從 1 開始)。" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "`$loop->remaining`" msgstr "`$loop->remaining`" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "The iterations remaining in the loop." msgstr "迴圈中剩餘的迭代數。" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "`$loop->count`" msgstr "`$loop->count`" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "The total number of items in the array being iterated." msgstr "迭代中陣列內的總項目數。" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "`$loop->first`" msgstr "`$loop->first`" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "Whether this is the first iteration through the loop." msgstr "目前是否為迴圈的第一次迭代。" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "`$loop->last`" msgstr "`$loop->last`" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "Whether this is the last iteration through the loop." msgstr "目前是否為迴圈的最後一次迭代。" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "`$loop->even`" msgstr "`$loop->even`" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "Whether this is an even iteration through the loop." msgstr "目前是否為迴圈的偶數次迭代。" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "`$loop->odd`" msgstr "`$loop->odd`" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "Whether this is an odd iteration through the loop." msgstr "目前是否為迴圈的奇數次迭代。" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "`$loop->depth`" msgstr "`$loop->depth`" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "The nesting level of the current loop." msgstr "目前迴圈的巢狀深度等級。" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "`$loop->parent`" msgstr "`$loop->parent`" -#: docs/10.x/blade.md:block 98 (table) +#: docs/10.x/blade.md:block 102 (table) msgid "When in a nested loop, the parent's loop variable." msgstr "若在巢狀迴圈內,即代表上層的迴圈變數。" -#: docs/10.x/blade.md:block 100 (header) +#: docs/10.x/blade.md:block 104 (header) msgid "Conditional Classes & Styles" msgstr "按條件顯示/隱藏 Class 與 Style" -#: docs/10.x/blade.md:block 101 (paragraph) +#: docs/10.x/blade.md:block 105 (paragraph) msgid "The `@class` directive conditionally compiles a CSS class string. The directive accepts an array of classes where the array key contains the class or classes you wish to add, while the value is a boolean expression. If the array element has a numeric key, it will always be included in the rendered class list:" msgstr "`@class` 指示詞可以有條件地編譯 CSS class 字串。`@class` 指示詞接受一組包含 class 的陣列,其中,陣列的索引鍵代表欲新增的 class,陣列值則是一個布林運算式。若陣列的元素有數字索引鍵,則該元素一定會被加到轉譯後的 Class 列表上:" -#: docs/10.x/blade.md:block 102 (code) +#: docs/10.x/blade.md:block 106 (code) msgid "@php\n" " $isActive = false;\n" " $hasError = true;\n" @@ -864,11 +880,11 @@ msgstr "@php\n" "])>\n\n" "\n" -#: docs/10.x/blade.md:block 103 (paragraph) +#: docs/10.x/blade.md:block 107 (paragraph) msgid "Likewise, the `@style` directive may be used to conditionally add inline CSS styles to an HTML element:" msgstr "類似地,`@style` 指示詞可用來依照條件在 HTML 元素內顯示或隱藏內嵌 CSS 樣式:" -#: docs/10.x/blade.md:block 104 (code) +#: docs/10.x/blade.md:block 108 (code) msgid "@php\n" " $isActive = true;\n" "@endphp\n\n" @@ -886,15 +902,15 @@ msgstr "@php\n" "])>\n\n" "\n" -#: docs/10.x/blade.md:block 106 (header) +#: docs/10.x/blade.md:block 110 (header) msgid "Additional Attributes" msgstr "額外屬性" -#: docs/10.x/blade.md:block 107 (paragraph) +#: docs/10.x/blade.md:block 111 (paragraph) msgid "For convenience, you may use the `@checked` directive to easily indicate if a given HTML checkbox input is \"checked\". This directive will echo `checked` if the provided condition evaluates to `true`:" msgstr "為了方便起見,可以使用 `@checked` 指示詞用來可輕鬆地標示給定 HTML 勾選框為「^[已勾選](Checked)」。這個指示詞會在條件為 `true` 時 Echo `checked`:" -#: docs/10.x/blade.md:block 108 (code) +#: docs/10.x/blade.md:block 112 (code) msgid "active)) />\n" -#: docs/10.x/blade.md:block 109 (paragraph) +#: docs/10.x/blade.md:block 113 (paragraph) msgid "Likewise, the `@selected` directive may be used to indicate if a given select option should be \"selected\":" msgstr "類似地,`@selected` 指示詞可用來表示給定 Select 選項應為「^[已選擇](Selected)」:" -#: docs/10.x/blade.md:block 110 (code) +#: docs/10.x/blade.md:block 114 (code) msgid "\n" " @endforeach\n" "\n" -#: docs/10.x/blade.md:block 111 (paragraph) +#: docs/10.x/blade.md:block 115 (paragraph) msgid "Additionally, the `@disabled` directive may be used to indicate if a given element should be \"disabled\":" msgstr "此外,可使用 `@disabled` 指示詞來表示給定元素應為「disabled」:" -#: docs/10.x/blade.md:block 112 (code) +#: docs/10.x/blade.md:block 116 (code) msgid "\n" msgstr "\n" -#: docs/10.x/blade.md:block 113 (paragraph) +#: docs/10.x/blade.md:block 117 (paragraph) msgid "Moreover, the `@readonly` directive may be used to indicate if a given element should be \"readonly\":" msgstr "此外,使用 `@readonly` 指示詞可用來表示給定元素應為「readonly」:" -#: docs/10.x/blade.md:block 114 (code) +#: docs/10.x/blade.md:block 118 (code) msgid "isNotAdmin()) />\n" -#: docs/10.x/blade.md:block 115 (paragraph) +#: docs/10.x/blade.md:block 119 (paragraph) msgid "In addition, the `@required` directive may be used to indicate if a given element should be \"required\":" msgstr "此外,`@required` 指示詞可用來表示給定元素應為「required」:" -#: docs/10.x/blade.md:block 116 (code) +#: docs/10.x/blade.md:block 120 (code) msgid "isAdmin()) />\n" -#: docs/10.x/blade.md:block 118 (header) +#: docs/10.x/blade.md:block 122 (header) msgid "Including Subviews" msgstr "Include 子 View" -#: docs/10.x/blade.md:block 119 (quote) -msgid "**Note** While you're free to use the `@include` directive, Blade [components](#components) provide similar functionality and offer several benefits over the `@include` directive such as data and attribute binding." -msgstr "**Note** 雖然可以使用 `@include` 指示詞,但 Blade 的[元件](#components)提供了類似的功能,且比起 `@include` 指示詞來說功能更強,可繫結資料與屬性。" +#: docs/10.x/blade.md:block 123 (quote) +msgid "[!NOTE] While you're free to use the `@include` directive, Blade [components](#components) provide similar functionality and offer several benefits over the `@include` directive such as data and attribute binding." +msgstr "" -#: docs/10.x/blade.md:block 120 (paragraph) +#: docs/10.x/blade.md:block 124 (paragraph) msgid "Blade's `@include` directive allows you to include a Blade view from within another view. All variables that are available to the parent view will be made available to the included view:" msgstr "Blade 的 `@include` 指示詞可用來在 Blade View 中包含另一個 View。所有上層 View 中可用的變數在 Include 的 View 當中都保持可用:" -#: docs/10.x/blade.md:block 121 (code) +#: docs/10.x/blade.md:block 125 (code) msgid "
    \n" " @include('shared.errors')\n\n" "
    \n" @@ -986,81 +1002,81 @@ msgstr "
    \n" " \n" "
    \n" -#: docs/10.x/blade.md:block 122 (paragraph) +#: docs/10.x/blade.md:block 126 (paragraph) msgid "Even though the included view will inherit all data available in the parent view, you may also pass an array of additional data that should be made available to the included view:" msgstr "雖然 Include 的 View 會繼承其上層 View 中所有的資料,但也可以將要在包含的 View 中使用的資料作為陣列傳入:" -#: docs/10.x/blade.md:block 123 (code) +#: docs/10.x/blade.md:block 127 (code) msgid "@include('view.name', ['status' => 'complete'])\n" msgstr "@include('view.name', ['status' => 'complete'])\n" -#: docs/10.x/blade.md:block 124 (paragraph) +#: docs/10.x/blade.md:block 128 (paragraph) msgid "If you attempt to `@include` a view which does not exist, Laravel will throw an error. If you would like to include a view that may or may not be present, you should use the `@includeIf` directive:" msgstr "若嘗試 `@include` 一個不存在的 View,Laravel 會擲回錯誤。若想 Include 一個可能不存在的 View,應使用 `@includeIf` 指示詞:" -#: docs/10.x/blade.md:block 125 (code) +#: docs/10.x/blade.md:block 129 (code) msgid "@includeIf('view.name', ['status' => 'complete'])\n" msgstr "@includeIf('view.name', ['status' => 'complete'])\n" -#: docs/10.x/blade.md:block 126 (paragraph) +#: docs/10.x/blade.md:block 130 (paragraph) msgid "If you would like to `@include` a view if a given boolean expression evaluates to `true` or `false`, you may use the `@includeWhen` and `@includeUnless` directives:" msgstr "若想在某個布林表達式取值為 `true` 或 `false` 的時候 `@include` 一個 View,則可以使用 `@includeWhen` 與 `@includeUnless` 指示詞:" -#: docs/10.x/blade.md:block 127 (code) +#: docs/10.x/blade.md:block 131 (code) msgid "@includeWhen($boolean, 'view.name', ['status' => 'complete'])\n\n" "@includeUnless($boolean, 'view.name', ['status' => 'complete'])\n" msgstr "@includeWhen($boolean, 'view.name', ['status' => 'complete'])\n\n" "@includeUnless($boolean, 'view.name', ['status' => 'complete'])\n" -#: docs/10.x/blade.md:block 128 (paragraph) +#: docs/10.x/blade.md:block 132 (paragraph) msgid "To include the first view that exists from a given array of views, you may use the `includeFirst` directive:" msgstr "若要在某個包含了一些 View 的陣列中 Include 第一個存在的 View,可以使用 `includeFirst` 指示詞:" -#: docs/10.x/blade.md:block 129 (code) +#: docs/10.x/blade.md:block 133 (code) msgid "@includeFirst(['custom.admin', 'admin'], ['status' => 'complete'])\n" msgstr "@includeFirst(['custom.admin', 'admin'], ['status' => 'complete'])\n" -#: docs/10.x/blade.md:block 130 (quote) -msgid "**Warning** You should avoid using the `__DIR__` and `__FILE__` constants in your Blade views, since they will refer to the location of the cached, compiled view." -msgstr "**Warning** 應避免在 Blade View 中使用 `__DIR__` 與 `__FILE__` 常數,因為這些常數會參照到經過快取與編譯過的 View。" +#: docs/10.x/blade.md:block 134 (quote) +msgid "[!WARNING] You should avoid using the `__DIR__` and `__FILE__` constants in your Blade views, since they will refer to the location of the cached, compiled view." +msgstr "" -#: docs/10.x/blade.md:block 132 (header) -msgid "Rendering Views For Collections" -msgstr "為 Collection 轉譯 View" +#: docs/10.x/blade.md:block 136 (header) +msgid "Rendering Views for Collections" +msgstr "" -#: docs/10.x/blade.md:block 133 (paragraph) +#: docs/10.x/blade.md:block 137 (paragraph) msgid "You may combine loops and includes into one line with Blade's `@each` directive:" msgstr "可以通過 Blade 的 `@each` 指示詞來將迴圈與 Include 組合成一行:" -#: docs/10.x/blade.md:block 134 (code) +#: docs/10.x/blade.md:block 138 (code) msgid "@each('view.name', $jobs, 'job')\n" msgstr "@each('view.name', $jobs, 'job')\n" -#: docs/10.x/blade.md:block 135 (paragraph) +#: docs/10.x/blade.md:block 139 (paragraph) msgid "The `@each` directive's first argument is the view to render for each element in the array or collection. The second argument is the array or collection you wish to iterate over, while the third argument is the variable name that will be assigned to the current iteration within the view. So, for example, if you are iterating over an array of `jobs`, typically you will want to access each job as a `job` variable within the view. The array key for the current iteration will be available as the `key` variable within the view." msgstr "`@each` 指示詞的第一個引數是用來轉譯陣列或 Collection 中各個元素的 View。第二個引數則為要迭代的陣列或 Collection,而第三個引數則為要在 View 中被指派目前迭代的變數名稱。因此,舉例來說,若要迭代一個 `jobs` 陣列,通常我們會想在 View 中通過 `job` 變數來存取各個 Job。目前迭代的陣列索引鍵可在 View 中通過 `key` 存取。" -#: docs/10.x/blade.md:block 136 (paragraph) +#: docs/10.x/blade.md:block 140 (paragraph) msgid "You may also pass a fourth argument to the `@each` directive. This argument determines the view that will be rendered if the given array is empty." msgstr "也可以傳入第四個引數給 `@each` 指示詞。這個引數用來判斷當給定陣列為空時要被轉譯的 View。" -#: docs/10.x/blade.md:block 137 (code) +#: docs/10.x/blade.md:block 141 (code) msgid "@each('view.name', $jobs, 'job', 'view.empty')\n" msgstr "@each('view.name', $jobs, 'job', 'view.empty')\n" -#: docs/10.x/blade.md:block 138 (quote) -msgid "**Warning** Views rendered via `@each` do not inherit the variables from the parent view. If the child view requires these variables, you should use the `@foreach` and `@include` directives instead." -msgstr "**Warning** 通過 `@each` 所轉譯的 View 不會繼承其上層 View 的變數。若子 View 有需要這些變數,應使用 `@foreach` 與 `@include` 指示詞來代替。" +#: docs/10.x/blade.md:block 142 (quote) +msgid "[!WARNING] Views rendered via `@each` do not inherit the variables from the parent view. If the child view requires these variables, you should use the `@foreach` and `@include` directives instead." +msgstr "" -#: docs/10.x/blade.md:block 140 (header) +#: docs/10.x/blade.md:block 144 (header) msgid "The `@once` Directive" msgstr "`@once` 指示詞" -#: docs/10.x/blade.md:block 141 (paragraph) +#: docs/10.x/blade.md:block 145 (paragraph) msgid "The `@once` directive allows you to define a portion of the template that will only be evaluated once per rendering cycle. This may be useful for pushing a given piece of JavaScript into the page's header using [stacks](#stacks). For example, if you are rendering a given [component](#components) within a loop, you may wish to only push the JavaScript to the header the first time the component is rendered:" msgstr "`@once` 指示詞可以用來定義讓某部分的樣板在每個轉譯週期內只被轉譯一次。通常適用於想讓某部分的 JavaScript 的通過[堆疊](#stacks) Push 的頁面頭部時。舉例來說,若想在迴圈中轉譯某個給定的[元素](#components),可能會只想在第一次轉譯的時候將 JavaScript Push 到頭部:" -#: docs/10.x/blade.md:block 142 (code) +#: docs/10.x/blade.md:block 146 (code) msgid "@once\n" " @push('scripts')\n" " \n" "@endPushOnce\n" -#: docs/10.x/blade.md:block 146 (header) +#: docs/10.x/blade.md:block 150 (header) msgid "Raw PHP" msgstr "原始 PHP" -#: docs/10.x/blade.md:block 147 (paragraph) +#: docs/10.x/blade.md:block 151 (paragraph) msgid "In some situations, it's useful to embed PHP code into your views. You can use the Blade `@php` directive to execute a block of plain PHP within your template:" msgstr "在某些情況下,可能需要將 PHP 程式碼嵌入到 View 中。可以使用 Blade 的 `@php` 指示詞來在樣板中執行某一區塊的純 PHP:" -#: docs/10.x/blade.md:block 148 (code) +#: docs/10.x/blade.md:block 152 (code) msgid "@php\n" " $counter = 1;\n" "@endphp\n" @@ -1108,75 +1124,91 @@ msgstr "@php\n" " $counter = 1;\n" "@endphp\n" -#: docs/10.x/blade.md:block 150 (header) +#: docs/10.x/blade.md:block 153 (paragraph) +msgid "Or, if you only need to use PHP to import a class, you may use the `@use` directive:" +msgstr "" + +#: docs/10.x/blade.md:block 154 (code) +msgid "@use('App\\Models\\Flight')\n" +msgstr "" + +#: docs/10.x/blade.md:block 155 (paragraph) +msgid "A second argument may be provided to the `@use` directive to alias the imported class:" +msgstr "" + +#: docs/10.x/blade.md:block 156 (code) +msgid "@use('App\\Models\\Flight', 'FlightModel')\n" +msgstr "" + +#: docs/10.x/blade.md:block 158 (header) msgid "Comments" msgstr "註解" -#: docs/10.x/blade.md:block 151 (paragraph) +#: docs/10.x/blade.md:block 159 (paragraph) msgid "Blade also allows you to define comments in your views. However, unlike HTML comments, Blade comments are not included in the HTML returned by your application:" msgstr "在 Blade 中,我們也可以在 View 中定義註解。不過,與 HTML 註解不同,Blade 的註解不會包含在網站所回傳的 HTML 中:" -#: docs/10.x/blade.md:block 152 (code) +#: docs/10.x/blade.md:block 160 (code) msgid "{{-- This comment will not be present in the rendered HTML --}}\n" msgstr "{{-- 這條註解將不會出現在轉譯完的 HTML 中 --}}\n" -#: docs/10.x/blade.md:block 154 (header) +#: docs/10.x/blade.md:block 162 (header) msgid "Components" msgstr "元件" -#: docs/10.x/blade.md:block 155 (paragraph) +#: docs/10.x/blade.md:block 163 (paragraph) msgid "Components and slots provide similar benefits to sections, layouts, and includes; however, some may find the mental model of components and slots easier to understand. There are two approaches to writing components: class based components and anonymous components." msgstr "元件與 Slot 提供了與 Section, Layout 與 Include 類似的功能。不過,有些人可能會覺得元件跟 Slot 比較好懂。撰寫元件有兩種方法:一種是基於類別的元件,另一種則是匿名元件。" -#: docs/10.x/blade.md:block 156 (paragraph) +#: docs/10.x/blade.md:block 164 (paragraph) msgid "To create a class based component, you may use the `make:component` Artisan command. To illustrate how to use components, we will create a simple `Alert` component. The `make:component` command will place the component in the `app/View/Components` directory:" msgstr "若要建立基於類別的元件,可以使用 `make:component` Artisan 指令。為了解釋如何使用元件,我們將會建立一個簡單的 `Alert` 元件。`make:component` 指令會將元件放在 `app/View/Components` 目錄中:" -#: docs/10.x/blade.md:block 157 (code) +#: docs/10.x/blade.md:block 165 (code) msgid "php artisan make:component Alert\n" msgstr "php artisan make:component Alert\n" -#: docs/10.x/blade.md:block 158 (paragraph) +#: docs/10.x/blade.md:block 166 (paragraph) msgid "The `make:component` command will also create a view template for the component. The view will be placed in the `resources/views/components` directory. When writing components for your own application, components are automatically discovered within the `app/View/Components` directory and `resources/views/components` directory, so no further component registration is typically required." msgstr "`make:component` 指令也會為元件建立一個 View 樣板。這個樣板會被放在 `resources/views/components` 目錄內。當在為專案撰寫元件時,元件會在 `app/View/Components` 與 `resources/views/components` 目錄中被 Auto Discover (自動偵測),因此不需要進一步註冊元件。" -#: docs/10.x/blade.md:block 159 (paragraph) +#: docs/10.x/blade.md:block 167 (paragraph) msgid "You may also create components within subdirectories:" msgstr "也可以在子資料夾內建立元件:" -#: docs/10.x/blade.md:block 160 (code) +#: docs/10.x/blade.md:block 168 (code) msgid "php artisan make:component Forms/Input\n" msgstr "php artisan make:component Forms/Input\n" -#: docs/10.x/blade.md:block 161 (paragraph) +#: docs/10.x/blade.md:block 169 (paragraph) msgid "The command above will create an `Input` component in the `app/View/Components/Forms` directory and the view will be placed in the `resources/views/components/forms` directory." msgstr "上述指令會在 `app/View/Components/Forms` 目錄內建立一個 `Input` 元件,而 View 會被放在 `resources/views/components/forms` 目錄內。" -#: docs/10.x/blade.md:block 162 (paragraph) +#: docs/10.x/blade.md:block 170 (paragraph) msgid "If you would like to create an anonymous component (a component with only a Blade template and no class), you may use the `--view` flag when invoking the `make:component` command:" msgstr "若想建立匿名元件 (即,只有 Blade 樣板且無類別的元件),可在叫用 `make:component` 指令時使用 `--view` 旗標:" -#: docs/10.x/blade.md:block 163 (code) +#: docs/10.x/blade.md:block 171 (code) msgid "php artisan make:component forms.input --view\n" msgstr "php artisan make:component forms.input --view\n" -#: docs/10.x/blade.md:block 164 (paragraph) +#: docs/10.x/blade.md:block 172 (paragraph) msgid "The command above will create a Blade file at `resources/views/components/forms/input.blade.php` which can be rendered as a component via ``." msgstr "上述指令會在 `resources/views/components/forms/input.blade.php` 中建立一個 Blade 檔,可通過 `` 來轉譯這個元件。" -#: docs/10.x/blade.md:block 166 (header) +#: docs/10.x/blade.md:block 174 (header) msgid "Manually Registering Package Components" msgstr "手動註冊套件元件" -#: docs/10.x/blade.md:block 167 (paragraph) +#: docs/10.x/blade.md:block 175 (paragraph) msgid "When writing components for your own application, components are automatically discovered within the `app/View/Components` directory and `resources/views/components` directory." msgstr "在為專案撰寫元件時,元件會在 `app/View/Components` 與 `resources/views/components` 目錄下被 Auto Discover (自動偵測)。" -#: docs/10.x/blade.md:block 168 (paragraph) +#: docs/10.x/blade.md:block 176 (paragraph) msgid "However, if you are building a package that utilizes Blade components, you will need to manually register your component class and its HTML tag alias. You should typically register your components in the `boot` method of your package's service provider:" msgstr "不過,若想製作使用 Blade 元件的套件,則需要手動註冊元件類別與其 HTML 標籤別名。通常,應在套件的 Service Provider 內的 `boot` 方法中註冊你的元件:" -#: docs/10.x/blade.md:block 169 (code) +#: docs/10.x/blade.md:block 177 (code) msgid "use Illuminate\\Support\\Facades\\Blade;\n\n" "/**\n" " * Bootstrap your package's services.\n" @@ -1194,19 +1226,19 @@ msgstr "use Illuminate\\Support\\Facades\\Blade;\n\n" " Blade::component('package-alert', Alert::class);\n" "}\n" -#: docs/10.x/blade.md:block 170 (paragraph) +#: docs/10.x/blade.md:block 178 (paragraph) msgid "Once your component has been registered, it may be rendered using its tag alias:" msgstr "註冊好元件後,便可使用其標籤別名來轉譯:" -#: docs/10.x/blade.md:block 171 (code) +#: docs/10.x/blade.md:block 179 (code) msgid "\n" msgstr "\n" -#: docs/10.x/blade.md:block 172 (paragraph) +#: docs/10.x/blade.md:block 180 (paragraph) msgid "Alternatively, you may use the `componentNamespace` method to autoload component classes by convention. For example, a `Nightshade` package might have `Calendar` and `ColorPicker` components that reside within the `Package\\Views\\Components` namespace:" msgstr "或者,也可以使用 `componentNamespace` 方法來依照慣例自動載入元件類別。舉例來說,`Nightshade` 套件可能包含了放在 `Package\\Views\\Components` Namespace 下的 `Calendar` 與 `ColorPicker` 元件:" -#: docs/10.x/blade.md:block 173 (code) +#: docs/10.x/blade.md:block 181 (code) msgid "use Illuminate\\Support\\Facades\\Blade;\n\n" "/**\n" " * Bootstrap your package's services.\n" @@ -1224,47 +1256,47 @@ msgstr "use Illuminate\\Support\\Facades\\Blade;\n\n" " Blade::componentNamespace('Nightshade\\\\Views\\\\Components', 'nightshade');\n" "}\n" -#: docs/10.x/blade.md:block 174 (paragraph) +#: docs/10.x/blade.md:block 182 (paragraph) msgid "This will allow the usage of package components by their vendor namespace using the `package-name::` syntax:" msgstr "這樣依賴可以讓套件元件通過其 Vendor Namespace 來使用 `package-name::` 語法:" -#: docs/10.x/blade.md:block 175 (code) +#: docs/10.x/blade.md:block 183 (code) msgid "\n" "\n" msgstr "\n" "\n" -#: docs/10.x/blade.md:block 176 (paragraph) +#: docs/10.x/blade.md:block 184 (paragraph) msgid "Blade will automatically detect the class that's linked to this component by pascal-casing the component name. Subdirectories are also supported using \"dot\" notation." msgstr "Blade 會通過將元件名稱轉為 Pascal 命名法 (pascal-case) 來自動偵測與這個元件關連的類別。也可以使用「點」語法來支援子目錄。" -#: docs/10.x/blade.md:block 178 (header) +#: docs/10.x/blade.md:block 186 (header) msgid "Rendering Components" msgstr "轉譯元件" -#: docs/10.x/blade.md:block 179 (paragraph) +#: docs/10.x/blade.md:block 187 (paragraph) msgid "To display a component, you may use a Blade component tag within one of your Blade templates. Blade component tags start with the string `x-` followed by the kebab case name of the component class:" msgstr "若要顯示元件,可以在 Blade 樣板中使用 Blade 元件的標籤。Blade 元件標籤以 `x-` 開頭,並接上以 Kebab Case 命名法命名的元素類別:" -#: docs/10.x/blade.md:block 180 (code) +#: docs/10.x/blade.md:block 188 (code) msgid "\n\n" "\n" msgstr "\n\n" "\n" -#: docs/10.x/blade.md:block 181 (paragraph) +#: docs/10.x/blade.md:block 189 (paragraph) msgid "If the component class is nested deeper within the `app/View/Components` directory, you may use the `.` character to indicate directory nesting. For example, if we assume a component is located at `app/View/Components/Inputs/Button.php`, we may render it like so:" msgstr "若元件類別在 `app/View/Components` 目錄中嵌套多層,可以使用 `.` 字元來標示巢狀目錄。舉例來說,假設有個位於 `app/View/Components/Inputs/Button.php` 的元件,我們可以像這樣轉譯該元件:" -#: docs/10.x/blade.md:block 182 (code) +#: docs/10.x/blade.md:block 190 (code) msgid "\n" msgstr "\n" -#: docs/10.x/blade.md:block 183 (paragraph) +#: docs/10.x/blade.md:block 191 (paragraph) msgid "If you would like to conditionally render your component, you may define a `shouldRender` method on your component class. If the `shouldRender` method returns `false` the component will not be rendered:" msgstr "若想要有條件地轉譯元件,可在 Component 類別中定義 `shouldRender` 方法。若 `shouldRender` 方法回傳 `false`,則該元件就不會被轉譯:" -#: docs/10.x/blade.md:block 184 (code) +#: docs/10.x/blade.md:block 192 (code) msgid "use Illuminate\\Support\\Str;\n\n" "/**\n" " * Whether the component should be rendered\n" @@ -1282,23 +1314,23 @@ msgstr "use Illuminate\\Support\\Str;\n\n" " return Str::length($this->message) > 0;\n" "}\n" -#: docs/10.x/blade.md:block 186 (header) -msgid "Passing Data To Components" -msgstr "將資料傳給元件" +#: docs/10.x/blade.md:block 194 (header) +msgid "Passing Data to Components" +msgstr "" -#: docs/10.x/blade.md:block 187 (paragraph) +#: docs/10.x/blade.md:block 195 (paragraph) msgid "You may pass data to Blade components using HTML attributes. Hard-coded, primitive values may be passed to the component using simple HTML attribute strings. PHP expressions and variables should be passed to the component via attributes that use the `:` character as a prefix:" msgstr "可以使用 HTML 屬性來將資料傳給 Blade 元素。硬式編碼或原生值可以使用簡單的 HTML 屬性字串來傳給元素。PHP 表達式與變數應使用以 `:` 字元作為前綴的屬性來傳遞:" -#: docs/10.x/blade.md:block 188 (code) +#: docs/10.x/blade.md:block 196 (code) msgid "\n" msgstr "\n" -#: docs/10.x/blade.md:block 189 (paragraph) +#: docs/10.x/blade.md:block 197 (paragraph) msgid "You should define all of the component's data attributes in its class constructor. All public properties on a component will automatically be made available to the component's view. It is not necessary to pass the data to the view from the component's `render` method:" msgstr "請在元件的類別建構函式中定義所有元件所需的資料屬性。元件中所有 Public 的屬性都會自動在元件的 View 中可用。不需要在元件的 `render` 方法中將這些資料傳給 View:" -#: docs/10.x/blade.md:block 190 (code) +#: docs/10.x/blade.md:block 198 (code) msgid "\n" " {{ $message }}\n" "
    \n" @@ -1354,15 +1386,15 @@ msgstr "
    \n" " {{ $message }}\n" "
    \n" -#: docs/10.x/blade.md:block 194 (header) +#: docs/10.x/blade.md:block 202 (header) msgid "Casing" msgstr "大小寫" -#: docs/10.x/blade.md:block 195 (paragraph) +#: docs/10.x/blade.md:block 203 (paragraph) msgid "Component constructor arguments should be specified using `camelCase`, while `kebab-case` should be used when referencing the argument names in your HTML attributes. For example, given the following component constructor:" msgstr "元件建構函式中的引數應以 `camelCase` 來指定,而在 HTML 屬性中參照其引數名稱時應使用 `kebab-case`。舉例來說,假設有下列元件建構函式:" -#: docs/10.x/blade.md:block 196 (code) +#: docs/10.x/blade.md:block 204 (code) msgid "/**\n" " * Create the component instance.\n" " */\n" @@ -1376,23 +1408,23 @@ msgstr "/**\n" " public string $alertType,\n" ") {}\n" -#: docs/10.x/blade.md:block 197 (paragraph) +#: docs/10.x/blade.md:block 205 (paragraph) msgid "The `$alertType` argument may be provided to the component like so:" msgstr "可以像這樣將 `$alertType` 引數提供給元件:" -#: docs/10.x/blade.md:block 198 (code) +#: docs/10.x/blade.md:block 206 (code) msgid "\n" msgstr "\n" -#: docs/10.x/blade.md:block 200 (header) +#: docs/10.x/blade.md:block 208 (header) msgid "Short Attribute Syntax" msgstr "簡短的屬性語法" -#: docs/10.x/blade.md:block 201 (paragraph) +#: docs/10.x/blade.md:block 209 (paragraph) msgid "When passing attributes to components, you may also use a \"short attribute\" syntax. This is often convenient since attribute names frequently match the variable names they correspond to:" msgstr "將屬性傳入元件時,也可以使用「簡短屬性」語法。由於屬性名稱常常都與對應的變數名稱相同,因此此功能應該適用於大多數情況下:" -#: docs/10.x/blade.md:block 202 (code) +#: docs/10.x/blade.md:block 210 (code) msgid "{{-- Short attribute syntax... --}}\n" "\n\n" "{{-- Is equivalent to... --}}\n" @@ -1402,15 +1434,15 @@ msgstr "{{-- 簡短屬性語法... --}}\n" "{{-- 對應於... --}}\n" "\n" -#: docs/10.x/blade.md:block 204 (header) +#: docs/10.x/blade.md:block 212 (header) msgid "Escaping Attribute Rendering" msgstr "逸出屬性轉譯" -#: docs/10.x/blade.md:block 205 (paragraph) +#: docs/10.x/blade.md:block 213 (paragraph) msgid "Since some JavaScript frameworks such as Alpine.js also use colon-prefixed attributes, you may use a double colon (`::`) prefix to inform Blade that the attribute is not a PHP expression. For example, given the following component:" msgstr "由於有些像 Alpine.js 的 JavaScript 框架也使用分號前綴的屬性,因此可以在 Blade 中使用雙分號(`::`)來提示 Blade 其屬性並非 PHP 運算式。舉例來說,假設有下列元件:" -#: docs/10.x/blade.md:block 206 (code) +#: docs/10.x/blade.md:block 214 (code) msgid "\n" " Submit\n" "\n" @@ -1418,11 +1450,11 @@ msgstr "\n" " 送出\n" "\n" -#: docs/10.x/blade.md:block 207 (paragraph) +#: docs/10.x/blade.md:block 215 (paragraph) msgid "The following HTML will be rendered by Blade:" msgstr "Blade 會轉譯為下列 HTML:" -#: docs/10.x/blade.md:block 208 (code) +#: docs/10.x/blade.md:block 216 (code) msgid "\n" @@ -1430,15 +1462,15 @@ msgstr "\n" -#: docs/10.x/blade.md:block 210 (header) +#: docs/10.x/blade.md:block 218 (header) msgid "Component Methods" msgstr "元件方法" -#: docs/10.x/blade.md:block 211 (paragraph) +#: docs/10.x/blade.md:block 219 (paragraph) msgid "In addition to public variables being available to your component template, any public methods on the component may be invoked. For example, imagine a component that has an `isSelected` method:" msgstr "除了公用變數可以在元件樣板中使用以外,元件內的任何公用方法也可以被叫用。舉例來說,假設某個有 `isSelected` 方法的元件:" -#: docs/10.x/blade.md:block 212 (code) +#: docs/10.x/blade.md:block 220 (code) msgid "/**\n" " * Determine if the given option is the currently selected option.\n" " */\n" @@ -1454,11 +1486,11 @@ msgstr "/**\n" " return $option === $this->selected;\n" "}\n" -#: docs/10.x/blade.md:block 213 (paragraph) +#: docs/10.x/blade.md:block 221 (paragraph) msgid "You may execute this method from your component template by invoking the variable matching the name of the method:" msgstr "可以在元件樣板中通過叫用與方法名稱相同的變數來執行此方法:" -#: docs/10.x/blade.md:block 214 (code) +#: docs/10.x/blade.md:block 222 (code) msgid "\n" @@ -1466,15 +1498,15 @@ msgstr "