@@ -121,7 +121,8 @@ export default function () {
121
121
</ P >
122
122
< P >
123
123
This interface requires a < Code > toInertiaProperty</ Code > method that receives a < Code > PropertyContext</ Code > object
124
- containing the property key, current props, and request instance.
124
+ containing the property key (< Code > $context-> key </ Code > ), all props for the page (< Code > $context-> props </ Code > ), and the
125
+ request instance (< Code > $context-> request </ Code > ).
125
126
</ P >
126
127
< TabbedCode
127
128
examples = { [
@@ -136,7 +137,7 @@ export default function () {
136
137
{
137
138
public function __construct(protected User $user, protected int $size = 64) {}
138
139
139
- public function toInertiaProperty(PropertyContext $prop ): mixed
140
+ public function toInertiaProperty(PropertyContext $context ): mixed
140
141
{
141
142
return $this->user->avatar
142
143
? Storage::url($this->user->avatar)
@@ -182,10 +183,10 @@ export default function () {
182
183
{
183
184
public function __construct(protected array $items = []) {}
184
185
185
- public function toInertiaProperty(PropertyContext $prop ): mixed
186
+ public function toInertiaProperty(PropertyContext $context ): mixed
186
187
{
187
188
// Access the property key to get shared data
188
- $shared = Inertia::getShared($prop ->key, []);
189
+ $shared = Inertia::getShared($context ->key, []);
189
190
190
191
// Merge with the new items
191
192
return array_merge($shared, $this->items);
@@ -210,7 +211,8 @@ export default function () {
210
211
</ P >
211
212
< P >
212
213
This interface requires a < Code > toInertiaProperties</ Code > method that returns an array of key-value pairs. The
213
- method receives a < Code > RenderContext</ Code > object containing the request and component name.
214
+ method receives a < Code > RenderContext</ Code > object containing the component name (< Code > $context-> component </ Code > )
215
+ and request instance (< Code > $context-> request </ Code > ).
214
216
</ P >
215
217
< TabbedCode
216
218
examples = { [
0 commit comments