We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1812aeb commit 5eb953eCopy full SHA for 5eb953e
docs/pages/basic-usage.md
@@ -133,6 +133,16 @@ You can also use magic methods with for cleaner syntax:
133
'name' => $this->unlessStateMinimal($this->full_name),
134
```
135
136
+### Manual State Access
137
+
138
+If you need more complex logic than inline conditionals, you can access the resource's current state directly using the `getState()` method:
139
140
+```php
141
+if ($this->getState() === 'full') {
142
+ // Do something specific for the full state
143
+}
144
+```
145
146
## Using Stateful Resources
147
148
### Setting the State Explicitly
0 commit comments