| 1: | <?php |
| 2: | |
| 3: | namespace LaravelUi5\Core\Controllers; |
| 4: | |
| 5: | use Illuminate\Http\JsonResponse; |
| 6: | use LaravelUi5\Core\Contracts\ExecutableInvokerInterface; |
| 7: | use LaravelUi5\Core\Contracts\Ui5ContextInterface; |
| 8: | use LaravelUi5\Core\Ui5\Contracts\Ui5ActionInterface; |
| 9: | |
| 10: | |
| 11: | |
| 12: | |
| 13: | |
| 14: | |
| 15: | |
| 16: | |
| 17: | |
| 18: | |
| 19: | |
| 20: | |
| 21: | |
| 22: | |
| 23: | class ActionDispatchController |
| 24: | { |
| 25: | public function __invoke(Ui5ContextInterface $context, ExecutableInvokerInterface $invoker): JsonResponse |
| 26: | { |
| 27: | |
| 28: | $action = $context->artifact(); |
| 29: | |
| 30: | $result = $invoker->invoke( |
| 31: | $action->getHandler(), |
| 32: | 'handle' |
| 33: | ); |
| 34: | |
| 35: | return response()->json($result); |
| 36: | } |
| 37: | } |
| 38: | |