Skip to content

Commit 9ffdbee

Browse files
committed
added home urls config
1 parent 6895de0 commit 9ffdbee

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/.idea
2+
/.history
23
/.vscode
34
/build
45
/vendor
56
composer.phar
67
composer.lock
78
.DS_Store
8-
.phpunit.result.cache
9+
.phpunit.result.cache

src/Config/menu.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
return [
44

55
'styles' => [
6-
76
// Boostrap 3
87
'bs3-navbar' => \Akaunting\Menu\Presenters\Bootstrap3\Navbar::class,
98
'bs3-navbar-right' => \Akaunting\Menu\Presenters\Bootstrap3\NavbarRight::class,
@@ -19,7 +18,10 @@
1918
'adminlte' => \Akaunting\Menu\Presenters\Admin\Adminlte::class,
2019
'argon' => \Akaunting\Menu\Presenters\Admin\Argon::class,
2120
'metronic-horizontal' => \Akaunting\Menu\Presenters\Admin\MetronicHorizontal::class,
22-
21+
],
22+
23+
'home_urls' => [
24+
'/',
2325
],
2426

2527
'ordering' => false,

src/MenuItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ protected function getActiveStateFromUrl()
587587
*/
588588
protected function checkActiveState($url)
589589
{
590-
if (empty($url) || ($url == '/')) {
590+
if (empty($url) || in_array($url, config('menu.home_urls', ['/']))) {
591591
return Request::is($url);
592592
} else {
593593
return Request::is($url, $url . '/*');

0 commit comments

Comments
 (0)