Update 01-overview.md

This commit is contained in:
Dan Harrin
2025-04-11 13:55:49 +01:00
parent 09f6a78c41
commit d34d56b840
+6 -6
View File
@@ -274,9 +274,9 @@ Select::make('role')
IconEntry::make('is_admin')
->boolean()
->hiddenJs(>>>JS
\$get('role') !== 'staff'
JS)
->hiddenJs(<<<'JS'
$get('role') !== 'staff'
JS)
```
Although the code passed to `hiddenJs()` looks very similar to PHP, it is actually JavaScript. Filament provides the `$get()` utility function to JavaScript that behaves very similar to its PHP equivalent, but without requiring the depended-on entry to be `live()`.
@@ -295,9 +295,9 @@ Select::make('role')
IconEntry::make('is_admin')
->boolean()
->visibleJs(>>>JS
\$get('role') === 'staff'
JS)
->visibleJs(<<<'JS'
$get('role') === 'staff'
JS)
```
<Aside variant="info">