File tree Expand file tree Collapse file tree 7 files changed +13
-29
lines changed Expand file tree Collapse file tree 7 files changed +13
-29
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) .
66
7+ ## [ 1.0.0-RC5] - 2025-09-
8+
9+
710## [ 1.0.0-RC4] - 2025-09-19
811- Documentation tweaks
912- AbstractActionHandler implements ParameterizableInterface
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1919use LaravelUi5 \Core \Exceptions \InvalidParameterValueException ;
2020use LaravelUi5 \Core \Exceptions \InvalidPathException ;
2121use LaravelUi5 \Core \Exceptions \MissingRequiredParameterException ;
22- use LaravelUi5 \Core \Exceptions \MissingUriKeyException ;
2322use LaravelUi5 \Core \Exceptions \NoModelFoundForParameterException ;
2423use LaravelUi5 \Core \Ui5 \Contracts \ParameterizableInterface ;
2524use ReflectionClass ;
@@ -40,6 +39,7 @@ public function resolve(ParameterizableInterface $target): Ui5Args
4039 $ attributes = $ reflection ->getAttributes (Parameter::class);
4140 $ uriKeys = $ this ->getUriKeys ();
4241 $ out = [];
42+ $ index = 0 ;
4343
4444 /** @var Parameter $attribute */
4545 foreach ($ attributes as $ a ) {
@@ -50,10 +50,7 @@ public function resolve(ParameterizableInterface $target): Ui5Args
5050 // 1. Get the raw value
5151 switch ($ attribute ->source ) {
5252 case ParameterSource::Path:
53- if (null === $ attribute ->uriKey ) {
54- throw new MissingUriKeyException ($ name );
55- }
56- $ raw = $ uriKeys [$ attribute ->uriKeyPosition ] ?? null ;
53+ $ raw = $ uriKeys [$ index ] ?? null ;
5754 break ;
5855 case ParameterSource::Query:
5956 $ raw = $ this ->request ->query ($ name );
Original file line number Diff line number Diff line change 44
55use LaravelUi5 \Core \Contracts \Ui5Args ;
66use LaravelUi5 \Core \Ui5 \Contracts \ActionHandlerInterface ;
7- use LaravelUi5 \Core \Ui5 \Contracts \ParameterizableInterface ;
87
9- abstract class AbstractActionHandler implements ActionHandlerInterface, ParameterizableInterface
8+ abstract class AbstractActionHandler implements ActionHandlerInterface
109{
1110 protected Ui5Args $ args ;
1211
Original file line number Diff line number Diff line change 88use LaravelUi5 \Core \Exceptions \InvalidParameterSourceException ;
99use LaravelUi5 \Core \Ui5 \Contracts \LaravelUi5ManifestInterface ;
1010use LaravelUi5 \Core \Ui5 \Contracts \LaravelUi5ManifestKeys ;
11- use LaravelUi5 \Core \Ui5 \Contracts \Ui5ActionInterface ;
11+ use LaravelUi5 \Core \Ui5 \Contracts \ParameterizableInterface ;
1212use LaravelUi5 \Core \Ui5 \Contracts \Ui5RegistryInterface ;
1313use ReflectionClass ;
1414use RuntimeException ;
@@ -87,7 +87,7 @@ protected function buildActions(string $module): array
8787 throw new InvalidHttpMethodActionException ($ action ->getNamespace (), $ action ->getMethod ()->label ());
8888 }
8989
90- $ uri = collect ($ this ->getPathParameters ($ action ))
90+ $ uri = collect ($ this ->getPathParameters ($ action-> getHandler () ))
9191 ->map (fn (string $ parameter ) => "/{ {$ parameter }} " )
9292 ->implode ('' );
9393
@@ -100,9 +100,9 @@ protected function buildActions(string $module): array
100100 return $ actions ;
101101 }
102102
103- protected function getPathParameters (Ui5ActionInterface $ action ): array
103+ protected function getPathParameters (ParameterizableInterface $ target ): array
104104 {
105- $ reflection = new ReflectionClass ($ action );
105+ $ reflection = new ReflectionClass ($ target );
106106 $ attributes = $ reflection ->getAttributes (Parameter::class);
107107 $ parameters = [];
108108 foreach ($ attributes as $ attr ) {
Original file line number Diff line number Diff line change 2323 * feature flags that influence runtime behavior.
2424 *
2525 * Notes:
26- * - URI parameters are resolved at the Action level (via
27- * {@see Ui5ActionInterface} + {@see ParameterizableInterface}),
28- * not on the handler itself.
26+ * - Input expectations are declared via {@see ParameterizableInterface},
2927 * - ActionHandlers must always return a structured result, even if
3028 * no payload is strictly required (e.g., a simple status + message).
3129 * - Dependencies (repositories, services) should be injected via
3230 * constructor dependency injection for testability and clarity.
3331 */
34- interface ActionHandlerInterface extends ExecutableInterface
32+ interface ActionHandlerInterface extends ExecutableInterface, ParameterizableInterface
3533{
3634}
Original file line number Diff line number Diff line change 1616 * Characteristics:
1717 * - Actions are always *mutating* operations (never pure reads).
1818 * - Therefore, they must only be exposed as *POST endpoints*.
19- * - Route parameters (IDs, slugs) are declared on the Action and resolved
19+ * - Route parameters (IDs, slugs) are declared on the ActionHandler and resolved
2020 * via {@see ParameterizableInterface}. The dispatcher validates and
2121 * injects these before calling the handler.
2222 * - Body parameters (form data, payloads) are validated *inside the
2323 * ActionHandler*, following Laravel best practices.
2424 *
2525 * Responsibilities:
2626 * - Define the action’s slug (via {@see SluggableInterface}).
27- * - Optionally implement {@see ParameterizableInterface} to declare
28- * URI parameters.
2927 * - Provide the {@see ActionHandlerInterface} that executes the logic.
3028 *
3129 * Each Action must have a unique slug within its module. The slug is used
You can’t perform that action at this time.
0 commit comments