File tree Expand file tree Collapse file tree 4 files changed +22
-12
lines changed
Expand file tree Collapse file tree 4 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ protected function food(Builder $query): void
4747```
4848
4949``` antlers
50- {{ runway:post scope ="food" }}
50+ {{ runway:post query_scope ="food" }}
5151 <h2>{{ title }}</h2>
5252 <p>{{ intro_text }}</p>
5353{{ /runway:post }}
@@ -56,15 +56,15 @@ protected function food(Builder $query): void
5656If you need to you can provide arguments to the scope like so:
5757
5858``` antlers
59- {{ runway:post scope ="food:argument" }}
59+ {{ runway:post query_scope ="food:argument" }}
6060```
6161
6262In the above example, ` argument ` can either be a string or we'll grab it from 'the context' (the available variables) if we can find it.
6363
6464You may also provide multiple scopes, if that's something you need...
6565
6666``` antlers
67- {{ runway:post scope ="food:argument|fastfood" }}
67+ {{ runway:post query_scope ="food:argument|fastfood" }}
6868```
6969
7070### Filtering
Original file line number Diff line number Diff line change @@ -42,6 +42,16 @@ We highly recommend upgrading all the way to Laravel 12 and PHP 8.4.
4242
4343## Medium impact changes
4444
45+ ### The ` scope ` parameter on the Runway tag has been renamed
46+ ** Affects app using the ` scope ` parameter on the Runway tag**
47+
48+ The ` scope ` parameter on the Runway tag has been renamed to ` query_scope ` to avoid conflicts with Antlers' own ` scope ` parameter.
49+
50+ ``` antlers
51+ {{ runway:post scope="food" }} {{# [!code --] #}}
52+ {{ runway:post query_scope="food" }} {{# [!code ++] #}}
53+ ```
54+
4555### ` runway:rebuild-uri-cache ` no longer removes global query scopes
4656
4757The ` runway:rebuild-uri-cache ` command no longer removes global query scopes when querying models. If you were relying on this behaviour, you may remove global scopes using the ` runwayRoutes ` query scope:
Original file line number Diff line number Diff line change @@ -64,13 +64,13 @@ protected function query(): Builder
6464 $ query ->select (explode (', ' , (string ) $ select ));
6565 }
6666
67- if ($ scopes = $ this ->params ->get ('scope ' )) {
68- $ scopes = explode ('| ' , (string ) $ scopes );
67+ if ($ queryScopes = $ this ->params ->get ('query_scope ' )) {
68+ $ queryScopes = explode ('| ' , (string ) $ queryScopes );
6969
70- foreach ($ scopes as $ scope ) {
71- $ scopeName = explode (': ' , $ scope )[0 ];
72- $ scopeArguments = isset (explode (': ' , $ scope )[1 ])
73- ? explode (', ' , explode (': ' , $ scope )[1 ])
70+ foreach ($ queryScopes as $ queryScope ) {
71+ $ scopeName = explode (': ' , $ queryScope )[0 ];
72+ $ scopeArguments = isset (explode (': ' , $ queryScope )[1 ])
73+ ? explode (', ' , explode (': ' , $ queryScope )[1 ])
7474 : [];
7575
7676 foreach ($ scopeArguments as $ key => $ scopeArgument ) {
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ public function can_get_models_with_scope_parameter()
9393 $ posts [4 ]->update (['title ' => 'Burger ' ]);
9494
9595 $ this ->tag ->setParameters ([
96- 'scope ' => 'food ' ,
96+ 'query_scope ' => 'food ' ,
9797 ]);
9898
9999 $ usage = $ this ->tag ->wildcard ('post ' );
@@ -118,7 +118,7 @@ public function can_get_models_with_scope_parameter_and_scope_arguments()
118118 ]);
119119
120120 $ this ->tag ->setParameters ([
121- 'scope ' => 'fruit:fab ' ,
121+ 'query_scope ' => 'fruit:fab ' ,
122122 ]);
123123
124124 $ usage = $ this ->tag ->wildcard ('post ' );
@@ -141,7 +141,7 @@ public function can_get_models_with_scope_parameter_and_scope_arguments_and_mult
141141 ]);
142142
143143 $ this ->tag ->setParameters ([
144- 'scope ' => 'food|fruit:fab ' ,
144+ 'query_scope ' => 'food|fruit:fab ' ,
145145 ]);
146146
147147 $ usage = $ this ->tag ->wildcard ('post ' );
You can’t perform that action at this time.
0 commit comments