From 80f237027f176d74752f0f2fd2ab8edab36691a3 Mon Sep 17 00:00:00 2001 From: Serhii Korneliuk Date: Tue, 14 May 2024 13:23:06 +0300 Subject: [PATCH] [FIX] Route with action ID. --- src/Controllers/sSettingsController.php | 11 ----------- src/Facades/sSettings.php | 6 ++++++ src/sSettings.php | 12 ++++++++++-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/Controllers/sSettingsController.php b/src/Controllers/sSettingsController.php index 20cf65c..0f5ae8b 100644 --- a/src/Controllers/sSettingsController.php +++ b/src/Controllers/sSettingsController.php @@ -12,17 +12,6 @@ class sSettingsController { - //public $url; - - /** - * Construct - */ - public function __construct() - { - //$this->url = $this->moduleUrl(); - //Paginator::defaultView('pagination'); - } - /** * Show tabs with custom system settings * diff --git a/src/Facades/sSettings.php b/src/Facades/sSettings.php index 7f34c7e..60396af 100644 --- a/src/Facades/sSettings.php +++ b/src/Facades/sSettings.php @@ -2,6 +2,12 @@ use Illuminate\Support\Facades\Facade; +/** + * Class sSettings + * + * @package Seiger\sSettings + * @mixin \Seiger\sSettings\sSettings + */ class sSettings extends Facade { /** diff --git a/src/sSettings.php b/src/sSettings.php index 35c1f22..953c962 100644 --- a/src/sSettings.php +++ b/src/sSettings.php @@ -31,7 +31,7 @@ public function listType(): array } /** - * Get url from route name + * Get url from route name with action id * * @param string $name Route name * @return string @@ -42,6 +42,14 @@ public function route(string $name): string if (evo()->getConfig('friendly_url_suffix', '') != '/') { $route = str_ireplace(evo()->getConfig('friendly_url_suffix', ''), '', route($name)); } - return $route; + + $a = 0; + $arr = str_split($name, 1); + foreach ($arr as $n) { + $a += ord($n); + } + $a = $a < 999 ? $a + 999 : $a; + + return $route.'?a='.$a; } }