jeroennoten / Laravel-AdminLTE

Easy AdminLTE integration with Laravel
MIT License
3.82k stars 1.08k forks source link

Sub menu active based on url does not work #1268

Closed Tonmoy-DAPL closed 5 months ago

Tonmoy-DAPL commented 5 months ago

Describe the issue

The followings is happening on my site https://example.com/admin/users-list

Menu lIst Users --List (sub menu is active for https://example.com/admin/users-list)

Menu lIst Users --List (sub menu is not active for https://example.com/admin/users-detail/7)

How can i activate the sub menu for the following https://example.com/admin/users-detail/7

dfsmania commented 5 months ago

@Tonmoy-DAPL in these situations you can use the active property, so for example, for the list menu entry you can define the active property as next:

'active' => ['admin/users-list', 'admin/users-detail/*']

The definition was done considering https://example.com is your root URL, if it's https://example.com/admin then you should remove the admin/ prefix in the active property.

Tonmoy-DAPL commented 5 months ago

@dfsmania Thanks for your help It's working perfect on my server

dfsmania commented 5 months ago

Solved!