diff --git a/src/Flow.php b/src/Flow.php index 1383e18..a514b3c 100644 --- a/src/Flow.php +++ b/src/Flow.php @@ -400,25 +400,26 @@ private function flow_pack() { } /** - * Genera una URL de acuerdo al método de Laravel + * Genera una URL utilizando las funciones de Laravel * - * @param array $url + * @param mixed $url * @return string */ private function generarUrl($url) { - if (array_key_exists('url', $url)) { - return url($url['url']); - } + if (is_array($url)) { + if (array_key_exists('url', $url)) + return url($url['url']); - if (array_key_exists('route', $url)) { - return route($url['route']); - } + if (array_key_exists('route', $url)) + return route($url['route']); - if (array_key_exists('action', $url)) { - return action($url['action']); - } + if (array_key_exists('action', $url)) + return action($url['action']); - return ''; + return ''; + } else { + return $url; + } } } diff --git a/src/FlowServiceProvider.php b/src/FlowServiceProvider.php index 0ec68f6..1022653 100644 --- a/src/FlowServiceProvider.php +++ b/src/FlowServiceProvider.php @@ -38,9 +38,7 @@ public function register() private function bindFlowClass() { $this->app->bind(Flow::class, function ($app) { - $flow = new Flow(); - - return $flow; + return new Flow(); }); } diff --git a/src/config/config.php b/src/config/config.php index de4fdbc..c9ac0c6 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -8,6 +8,7 @@ |-------------------------------------------------------------------------- | | Valores posibles: + | 'http://www.comercio.cl/kpf/exito.php', | ['url' => 'flow/exito'], | ['route' => 'flow.exito'], | ['action' => 'FlowController@exito'], @@ -22,6 +23,7 @@ |-------------------------------------------------------------------------- | | Valores posibles: + | 'http://www.comercio.cl/kpf/fracaso.php', | ['url' => 'flow/fracaso'], | ['route' => 'flow.fracaso'], | ['action' => 'FlowController@fracaso'], @@ -36,6 +38,7 @@ |-------------------------------------------------------------------------- | | Valores posibles: + | 'http://www.comercio.cl/kpf/confirma.php', | ['url' => 'flow/confirmacion'], | ['route' => 'flow.confirmacion'], | ['action' => 'FlowController@confirmacion'],