Skip to content

Commit 49bf7f4

Browse files
committed
docs
1 parent 28020fa commit 49bf7f4

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

docs/dist/4.x/schemas/forms/overview/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ <h2 id="setting-a-label">Setting a label</h2>
179179
<span class="line"><span style="color:#FFCB6B">TextInput</span><span style="color:#89DDFF">::</span><span style="color:#82AAFF">make</span><span style="color:#89DDFF">(</span><span style="color:#89DDFF">&#39;</span><span style="color:#C3E88D">name</span><span style="color:#89DDFF">&#39;</span><span style="color:#89DDFF">)</span></span>
180180
<span class="line"><span style="color:#89DDFF"> -&gt;</span><span style="color:#82AAFF">label</span><span style="color:#89DDFF">(</span><span style="color:#89DDFF">&#39;</span><span style="color:#C3E88D">Full name</span><span style="color:#89DDFF">&#39;</span><span style="color:#89DDFF">)</span></span>
181181
<span class="line"></span></code></pre>
182-
<details class="rounded-lg bg-[#ffede0] dark:bg-[#100f1b] border-2 border-[#ffd6b6] dark:border-[#282732] px-4 py-2"> <summary> The <code>label()</code> method accepts a function to dynamically inject utilities. </summary> <table class="block overflow-x-auto whitespace-nowrap mt-3 mb-0"> <thead> <tr class="border-b-2 border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-2 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Utility</th> <th class="p-2">Type</th> <th class="p-2">Variable</th> <th class="p-2">Description</th> </tr> </thead> <tbody> <tr class="border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Get</th> <td class="p-2"><code>Filament\Schemas\Components\Utilities\Get</code></td> <td class="p-2"><code>$get</code></td> <td class="p-2">A function for retrieving values from the current form data.</td> </tr><tr class="border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Eloquent model FQN</th> <td class="p-2"><code>string&lt;Illuminate\Database\Eloquent\Model&gt; | null</code></td> <td class="p-2"><code>$model</code></td> <td class="p-2">The Eloquent model FQN for the current schema.</td> </tr><tr class="border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Livewire</th> <td class="p-2"><code>Livewire\Component</code></td> <td class="p-2"><code>$livewire</code></td> <td class="p-2">The Livewire component instance.</td> </tr><tr class="border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Raw state</th> <td class="p-2"><code>mixed</code></td> <td class="p-2"><code>$rawState</code></td> <td class="p-2">The current value of the field, before state casts were applied.</td> </tr><tr class="border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">State</th> <td class="p-2"><code>mixed</code></td> <td class="p-2"><code>$state</code></td> <td class="p-2">The current value of the field.</td> </tr><tr class="border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Operation</th> <td class="p-2"><code>string</code></td> <td class="p-2"><code>$operation</code></td> <td class="p-2">The current operation being performed by the schema. Usually <code>create</code>, <code>edit</code>, or <code>view</code>.</td> </tr><tr class="border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Eloquent record</th> <td class="p-2"><code>Illuminate\Database\Eloquent\Model | null</code></td> <td class="p-2"><code>$record</code></td> <td class="p-2">The Eloquent record for the current schema.</td> </tr><tr class="border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Set</th> <td class="p-2"><code>Filament\Schemas\Components\Utilities\Set</code></td> <td class="p-2"><code>$set</code></td> <td class="p-2">A function for setting values in the current form data.</td> </tr> </tbody> </table> </details>
182+
<details class="rounded-lg bg-[#ffede0] dark:bg-[#100f1b] border-2 border-[#ffd6b6] dark:border-[#282732] px-4 py-2"> <summary> The <code>label()</code> method accepts a function to dynamically inject utilities. </summary> <table class="block overflow-x-auto whitespace-nowrap mt-3 mb-0"> <thead> <tr class="border-b-2 border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-2 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Utility</th> <th class="p-2">Type</th> <th class="p-2">Parameter</th> <th class="p-2">Description</th> </tr> </thead> <tbody> <tr class="border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Get</th> <td class="p-2"><code>Filament\Schemas\Components\Utilities\Get</code></td> <td class="p-2"><code>$get</code></td> <td class="p-2">A function for retrieving values from the current form data.</td> </tr><tr class="border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Eloquent model FQN</th> <td class="p-2"><code>?string&lt;Illuminate\Database\Eloquent\Model&gt;</code></td> <td class="p-2"><code>$model</code></td> <td class="p-2">The Eloquent model FQN for the current schema.</td> </tr><tr class="border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Livewire</th> <td class="p-2"><code>Livewire\Component</code></td> <td class="p-2"><code>$livewire</code></td> <td class="p-2">The Livewire component instance.</td> </tr><tr class="border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Raw state</th> <td class="p-2"><code>mixed</code></td> <td class="p-2"><code>$rawState</code></td> <td class="p-2">The current value of the field, before state casts were applied.</td> </tr><tr class="border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">State</th> <td class="p-2"><code>mixed</code></td> <td class="p-2"><code>$state</code></td> <td class="p-2">The current value of the field.</td> </tr><tr class="border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Operation</th> <td class="p-2"><code>string</code></td> <td class="p-2"><code>$operation</code></td> <td class="p-2">The current operation being performed by the schema. Usually <code>create</code>, <code>edit</code>, or <code>view</code>.</td> </tr><tr class="border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Eloquent record</th> <td class="p-2"><code>?Illuminate\Database\Eloquent\Model</code></td> <td class="p-2"><code>$record</code></td> <td class="p-2">The Eloquent record for the current schema.</td> </tr><tr class="border-[#ffd6b6] dark:border-[#282732]"> <th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Set</th> <td class="p-2"><code>Filament\Schemas\Components\Utilities\Set</code></td> <td class="p-2"><code>$set</code></td> <td class="p-2">A function for setting values in the current form data.</td> </tr> </tbody> </table> </details>
183183
<p>Customizing the label in this way is useful if you wish to use a <a href="https://laravel.com/docs/localization#retrieving-translation-strings">translation string for localization</a>:</p>
184184
<pre class="astro-code material-theme-palenight" style="background-color:#292D3E;color:#babed8;overflow-x:auto" tabindex="0" data-language="php"><code><span class="line"><span style="color:#F78C6C">use</span><span style="color:#BABED8"> Filament</span><span style="color:#89DDFF">\</span><span style="color:#BABED8">Forms</span><span style="color:#89DDFF">\</span><span style="color:#BABED8">Components</span><span style="color:#89DDFF">\</span><span style="color:#BABED8">TextInput</span><span style="color:#89DDFF">;</span></span>
185185
<span class="line"></span>

docs/src/components/UtilityInjectionDisclosure.astro renamed to docs/src/components/UtilityInjection.astro

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
11
---
2-
let { utilities } = Astro.props;
2+
const { set } = Astro.props;
33
4-
utilities = {
4+
const utilities = {
55
formFields: [
66
{
77
name: 'Get',
88
type: 'Filament\\Schemas\\Components\\Utilities\\Get',
9-
variable: '$get',
9+
parameter: '$get',
1010
description: 'A function for retrieving values from the current form data.',
1111
},
1212
{
1313
name: 'Eloquent model FQN',
14-
type: 'string<Illuminate\\Database\\Eloquent\\Model> | null',
15-
variable: '$model',
14+
type: '?string<Illuminate\\Database\\Eloquent\\Model>',
15+
parameter: '$model',
1616
description: 'The Eloquent model FQN for the current schema.',
1717
},
1818
{
1919
name: 'Livewire',
2020
type: 'Livewire\\Component',
21-
variable: '$livewire',
21+
parameter: '$livewire',
2222
description: 'The Livewire component instance.',
2323
},
2424
{
2525
name: 'Raw state',
2626
type: 'mixed',
27-
variable: '$rawState',
27+
parameter: '$rawState',
2828
description: 'The current value of the field, before state casts were applied.',
2929
},
3030
{
3131
name: 'State',
3232
type: 'mixed',
33-
variable: '$state',
33+
parameter: '$state',
3434
description: 'The current value of the field.',
3535
},
3636
{
3737
name: 'Operation',
3838
type: 'string',
39-
variable: '$operation',
39+
parameter: '$operation',
4040
description: 'The current operation being performed by the schema. Usually <code>create</code>, <code>edit</code>, or <code>view</code>.',
4141
},
4242
{
4343
name: 'Eloquent record',
44-
type: 'Illuminate\\Database\\Eloquent\\Model | null',
45-
variable: '$record',
44+
type: '?Illuminate\\Database\\Eloquent\\Model',
45+
parameter: '$record',
4646
description: 'The Eloquent record for the current schema.',
4747
},
4848
{
4949
name: 'Set',
5050
type: 'Filament\\Schemas\\Components\\Utilities\\Set',
51-
variable: '$set',
51+
parameter: '$set',
5252
description: 'A function for setting values in the current form data.',
5353
},
5454
],
55-
}[utilities]
55+
}[set]
5656
---
5757

5858
<details class="rounded-lg bg-[#ffede0] dark:bg-[#100f1b] border-2 border-[#ffd6b6] dark:border-[#282732] px-4 py-2">
@@ -65,7 +65,7 @@ utilities = {
6565
<tr class="border-b-2 border-[#ffd6b6] dark:border-[#282732]">
6666
<th class="py-2 ps-2 pe-4 sticky start-0 z-2 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">Utility</th>
6767
<th class="p-2">Type</th>
68-
<th class="p-2">Variable</th>
68+
<th class="p-2">Parameter</th>
6969
<th class="p-2">Description</th>
7070
</tr>
7171
</thead>
@@ -74,7 +74,7 @@ utilities = {
7474
{utilities.map((utility) => <tr class="border-[#ffd6b6] dark:border-[#282732]">
7575
<th class="py-2 ps-2 pe-4 sticky start-0 z-1 bg-[#ffede0] dark:bg-[#100f1b] after:content-['_'] after:bg-[#ffd6b6] dark:after:bg-[#282732] after:w-[2px] after:h-full after:absolute after:end-0 after:-my-2">{utility.name}</th>
7676
<td class="p-2"><code>{utility.type}</code></td>
77-
<td class="p-2"><code>{utility.variable}</code></td>
77+
<td class="p-2"><code>{utility.parameter}</code></td>
7878
<td class="p-2" set:html={utility.description}></td>
7979
</tr>)}
8080
</tbody>

0 commit comments

Comments
 (0)