Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 07-advanced.md, document isAbsolute for $get #15098

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/forms/docs/07-advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,16 @@ function (Get $get) {
}
```

By default `$get` uses relative paths, you can use the second parameter `isAbsolute` to provide the absolute path of the field. This path is not "absolute" from the current form, it is absolute for the entire Livewire component. You will need to prefix the whichever state path you're trying to access (usually `data.` or `mountedActionData.`
```php
use Filament\Forms\Get;

function (Get $get, true) {
$email = $get('data.email'); // Store the value of the `email` field in the `$email` variable.
//...
}
```

### Injecting a function to set the state of another field

In a similar way to `$get`, you may also set the value of another field from within a callback, using a `$set` parameter:
Expand Down
Loading