From fb219f877eeea6abed8fe333062901673d2813cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Sun, 10 Jan 2021 16:31:08 +0300 Subject: [PATCH] add alias for route --- app/Abstracts/View/Components/Document.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/Abstracts/View/Components/Document.php b/app/Abstracts/View/Components/Document.php index 45b66886f..362599aa1 100644 --- a/app/Abstracts/View/Components/Document.php +++ b/app/Abstracts/View/Components/Document.php @@ -62,9 +62,19 @@ abstract class Document extends Component return $route; } + $alias = config('type.' . $type . '.alias'); $prefix = config('type.' . $type . '.route.prefix'); - $route = $prefix . '.' . $config_key; + // if use module set module alias + if (!empty($alias)) { + $route .= $alias . '.'; + } + + if (!empty($prefix)) { + $route .= $prefix . '.'; + } + + $route .= $config_key; try { route($route, $config_parameters);