PHPackages                             norgeit/collapsible-resource-manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. norgeit/collapsible-resource-manager

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

norgeit/collapsible-resource-manager
====================================

A custom sidebar menu with collapsible groups

v1.2.7(5y ago)050MITPHPPHP &gt;=7.1.0

Since Sep 28Pushed 5y agoCompare

[ Source](https://github.com/ChengDi666/collapsible-resource-manager)[ Packagist](https://packagist.org/packages/norgeit/collapsible-resource-manager)[ RSS](/packages/norgeit-collapsible-resource-manager/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (25)Used By (0)

 &lt;title&gt;collapsible-resource-manager/README.md at master · niunaiyi/collapsible-resource-manager · GitHub&lt;/title&gt; ```

```

```

```

```

```

```

```

```

```

```

```

```

```

```

  Skip to content

```

```

```

 [ ](https://github.com/)```

            Sign&nbsp;up

                Why GitHub?

                Features &rarr;

                  Code review
                  Project management
                  Integrations
                  Actions
                  Packages
                  Security
                  Team management
                  Hosting
                  Mobile

                  Customer stories &rarr;
                  Security &rarr;

            Team

            Enterprise

                Explore

                  Explore GitHub &rarr;

                Learn &amp; contribute

                  Topics
                    Collections
                  Trending
                  Learning Lab
                  Open source guides

                Connect with others

                  Events
                  Community forum
                  GitHub Education
                  GitHub Stars program

            Marketplace

                Pricing

                Plans &rarr;

                  Compare plans
                  Contact Sales

                  Nonprofit &rarr;
                  Education &rarr;

 [![](https://camo.githubusercontent.com/d2775e1df67d65acf3082f4101e1f2c63f93537173138212172049fc42fc0139/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f696d616765732f7365617263682d6b65792d736c6173682e737667)](https://camo.githubusercontent.com/d2775e1df67d65acf3082f4101e1f2c63f93537173138212172049fc42fc0139/68747470733a2f2f6769746875622e6769746875626173736574732e636f6d2f696d616765732f7365617263682d6b65792d736c6173682e737667)```

```

-

    ```

        In this repository

        All GitHub

      ↵

      Jump to
      ↵

    ```

- No suggested jump to results

-

    ```

        In this repository

        All GitHub

      ↵

      Jump to
      ↵

    ```

-

    ```

        In this repository

        All GitHub

      ↵

      Jump to
      ↵

    ```

```

```

```

      Sign&nbsp;in

          Sign&nbsp;up

```

```

```

```

```

```
  {{ message }}

```

```

  niunaiyi

/

```

  **[collapsible-resource-manager](/niunaiyi/collapsible-resource-manager)**   forked from [ChengDi666/collapsible-resource-manager](/ChengDi666/collapsible-resource-manager) ```

```

5. [ Watch ](/login?return_to=%2Fniunaiyi%2Fcollapsible-resource-manager) [ 0 ](/niunaiyi/collapsible-resource-manager/watchers)
6. [ Star ](/login?return_to=%2Fniunaiyi%2Fcollapsible-resource-manager) [ 0 ](/niunaiyi/collapsible-resource-manager/stargazers)
7. [ Fork ](/login?return_to=%2Fniunaiyi%2Fcollapsible-resource-manager) [ 19 ](/niunaiyi/collapsible-resource-manager/network/members)
```

```

- [ Code ](/niunaiyi/collapsible-resource-manager)
- [ Pull requests 0](/niunaiyi/collapsible-resource-manager/pulls)
- [ Actions ](/niunaiyi/collapsible-resource-manager/actions)
- [ Projects 0](/niunaiyi/collapsible-resource-manager/projects)
- [ Security ](/niunaiyi/collapsible-resource-manager/security)
- [ Insights ](/niunaiyi/collapsible-resource-manager/pulse)

   More

```

                Code

```

2. [Pull requests ](/niunaiyi/collapsible-resource-manager/pulls)
3. [Actions ](/niunaiyi/collapsible-resource-manager/actions)
4. [Projects ](/niunaiyi/collapsible-resource-manager/projects)
5. [Security ](/niunaiyi/collapsible-resource-manager/security)
6. [Insights ](/niunaiyi/collapsible-resource-manager/pulse)

```
Permalink

      Dismiss

    Join GitHub today
    GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
    Sign up

```

```

```

   master  ```

```

```

    collapsible-resource-manager/README.md

    Go to file

```

  - [ Go to file T](/niunaiyi/collapsible-resource-manager/find/master)
- Go to line L
-
- Copy path

```

```

  [![@ChengDi666](https://avatars0.githubusercontent.com/u/56573987?s=48&v=4)](/ChengDi666)  [ChengDi666](/ChengDi666)```

            '自定义'

        Latest commit
        e012d7a
        Oct 12, 2020

          History

```

   **6**```
    contributors

        Users who have contributed to this file

```

 [![@sunchaintech](https://avatars0.githubusercontent.com/u/47603125?s=48&v=4)](/niunaiyi/collapsible-resource-manager/commits/master/README.md?author=sunchaintech) [![@bernhardh](https://avatars3.githubusercontent.com/u/642292?s=48&v=4)](/niunaiyi/collapsible-resource-manager/commits/master/README.md?author=bernhardh) [![@eugenevdm](https://avatars0.githubusercontent.com/u/1836436?s=48&v=4)](/niunaiyi/collapsible-resource-manager/commits/master/README.md?author=eugenevdm) [![@ChengDi666](https://avatars0.githubusercontent.com/u/56573987?s=48&v=4)](/niunaiyi/collapsible-resource-manager/commits/master/README.md?author=ChengDi666) [![@xoco70](https://avatars0.githubusercontent.com/u/5855577?s=48&v=4)](/niunaiyi/collapsible-resource-manager/commits/master/README.md?author=xoco70)

```

```

```
  242 lines (186 sloc)

10.3 KB

```

```

  Raw
    Blame

```

[](#collapsible-resource-manager)Collapsible Resource Manager
=============================================================

[](#collapsible-resource-manager)

[![Latest Version on Packagist](https://camo.githubusercontent.com/53f6fcfa977c9d449efc72dc3fbe74a669485e3c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6469676974616c2d63726561746976652f636f6c6c61707369626c652d7265736f757263652d6d616e61676572)](https://packagist.org/packages/digital-creative/collapsible-resource-manager)[![Total Downloads](https://camo.githubusercontent.com/b183a4f5f68bfaa1ecfa5f9044a1ef7ba0c7b65c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6469676974616c2d63726561746976652f636f6c6c61707369626c652d7265736f757263652d6d616e61676572)](https://packagist.org/packages/digital-creative/collapsible-resource-manager)[![License](https://camo.githubusercontent.com/a17949c526072a8ee4760d3e0761f7f1745c659e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6469676974616c2d63726561746976652f636f6c6c61707369626c652d7265736f757263652d6d616e61676572)](https://github.com/dcasia/collapsible-resource-manager/blob/master/LICENSE)

[![Laravel Nova Collapsible Resource Manager in action](https://raw.githubusercontent.com/dcasia/collapsible-resource-manager/master/screenshots/demo-1.png)](https://raw.githubusercontent.com/dcasia/collapsible-resource-manager/master/screenshots/demo-1.png)

Provides an easy way to order and group your resources on the sidebar.

[](#installation)Installation
=============================

[](#installation)

You can install the package via composer:

```
composer require digital-creative/collapsible-resource-manager

```

Next up, you must register the tool with Nova. This is typically done in the `tools` method of the `NovaServiceProvider.`

```
class NovaServiceProvider extends NovaApplicationServiceProvider
{
    public function tools()
    {
        return [
            // ...
            new CollapsibleResourceManager([
                'navigation' => [
                    TopLevelResource::make([
                        'label' => 'Resources',
                        'resources' => [
                            \App\Nova\User::class
                        ]
                    ]),
                ]
            ])
        ];
    }
}
```

#### [](#options)Options

[](#options)

```
new CollapsibleResourceManager([
    'disable_default_resource_manager' => true, // default
    'remember_menu_state' => false, // default
    'navigation' => [
        TopLevelResource::make(...),
        TopLevelResource::make(...)
    ]
]);
```

On the `navigation` key only `TopLevelResource` are allowed to be used, any other resource will be ignored.

[](#navigation-resources)Navigation Resources
=============================================

[](#navigation-resources)

#### [](#toplevelresource)TopLevelResource

[](#toplevelresource)

```
TopLevelResource::make([
    'label' => 'Resources',
    'expanded' => null,
    'badge' => null,
    'icon' => null,
    'linkTo' => null, // accepts an instance of `NovaResource` or a Nova `Resource::class`
    'resources' => [
        NovaResource::make(...),
        Group::make(...),
        LensResource::make(...),
        InternalLink::make(...),
        ExternalLink::make(...),
        RawResource::make(...)
    ]
]);
```

Top-Level items aren't collapsible by default (`'expanded' => null`). If you set `expanded` to `true` or `false`, it will show a collapsible indicator on the right side of the heading. If `true`, it will be open by default, if `false` it will be closed by default.

#### [](#novaresource)NovaResource

[](#novaresource)

You can either pass a `\App\Nova\Resource::class` or a instance of `NovaResource`

```
NovaResource::make(\App\Nova\Customer::class);
```

Additionally you can redirect the user to specific views on click by chaining one of these methods:

```
NovaResource::make(\App\Nova\Customer::class)->index(); // Open the create index for the given resource - default
NovaResource::make(\App\Nova\Customer::class)->create(); // Open the create view for the given resource
NovaResource::make(\App\Nova\Customer::class)->detail($resourceId); // Open the detail view for the given ID
NovaResource::make(\App\Nova\Customer::class)->edit($resourceId); // Open the form view of the given ID
```

Authorization is also respected for each of these views

#### [](#group)Group

[](#group)

Group appears as a toggle with a +/- sign that allows user to collapse multiple items into a single entry on the sidebar:

```
Group::make([
    'label' => 'Admin',
    'expanded' => false,
    'resources' => [
        // any resource instance
    ]
]);
```

#### [](#internallink)InternalLink

[](#internallink)

Internal Link is an easy way to manually direct user to an specific URL using the default navigation mechanism:

```
InternalLink::make([
    'label' => 'My custom internal link',
    'badge' => null,
    'icon' => null,
    'target' => '_self',
    'path' => '/my/custom/resource/url',
    'params' => [ 'resourceId' => 1 ],
    'query' => [' resource_per_page' => 100 ]
]);
```

#### [](#lensresource)LensResource

[](#lensresource)

Lens Resource is a quickly way to add an entry on the sidebar that directs the user directly to an lens view for a given resource,

It requires 2 params: the resource the lens was used and the lens class itself you want to link to:

```
LensResource::make(
    \App\Nova\Customer::class,
    \App\Nova\Lenses\MostValuableCustomers::class
);
```

#### [](#externallink)ExternalLink

[](#externallink)

External links are useful to add entries on the menu that redirects user to an external URL:

```
ExternalLink::make([
    'label' => 'Google',
    'badge' => null,
    'icon' => null,
    'target' => '_blank',
    'url' => 'https://google.com.br'
]);
```

#### [](#rawresource)RawResource

[](#rawresource)

If none of the pre-configured resources suffice your needs, RawResource provides an way to manually define what params the should be built with:

```
RawResource::make([
    'label' => 'Customer',
    'badge' => null,
    'icon' => null,
    'target' => '_self',
    'name' => 'index',
    'path' => null,
    'params' => [ 'resourceName' => 'customer' ],
    'query' => [ 'foo' => 'bar' ],
]);
```

[](#authorization)Authorization
===============================

[](#authorization)

All the resources uses `AuthorizedToSee` nova trait therefor they behave like tools and cards, where you can chain `canSee` to determine if the current logged in user is allowed to see the resource.

```
Group::make(...)->canSee(function($request) {
    return true/false;
});
```

By default `NovaResource` will follow the default policy registered for the given resource, however it can be overridden by chaining the `->canSee()` manually

[](#resource-labels-and-translations)Resource Labels and Translations
=====================================================================

[](#resource-labels-and-translations)

You can pass translated labels to any resource by calling the `->label()` method, eg:

```
NovaResource::make(\App\Nova\Customer::class)->label(function() { return __('Customer'); }); // or
NovaResource::make(\App\Nova\Customer::class)->label(__('Customer'));
```

[](#resource-icons)Resource Icons
=================================

[](#resource-icons)

You can define icons for `NovaResource` by either:

- Calling `->icon()` method on the `NovaResource` it accepts a `Closure` that returns a `string` or a `string` directly
- Setting a static method called `icon` that returns an string on the resource class:

```
class Customer extends Resource
{
    //...
    public static function icon(): string
    {
        return  '...',
]);
ExternalLink::make(...)->icon(function() { return '...' }); // or
ExternalLink::make(...)->icon('...');
```

[![Icons](https://raw.githubusercontent.com/dcasia/collapsible-resource-manager/master/screenshots/menu-icons.png)](https://raw.githubusercontent.com/dcasia/collapsible-resource-manager/master/screenshots/menu-icons.png)

[](#license)License
-------------------

[](#license)

The MIT License (MIT). Please see [License File](https://raw.githubusercontent.com/dcasia/collapsible-resource-manager/master/LICENSE) for more information.

```

```

   Go ```

```

```

```

 [ ](https://github.com "GitHub")- © 2020 GitHub, Inc.
- [Terms](https://github.com/site/terms)
- [Privacy](https://github.com/site/privacy)
- Cookie Preferences
- [Security](https://github.com/security)
- [Status](https://githubstatus.com/)
- [Help](https://docs.github.com)
- [Contact GitHub](https://github.com/contact)
- [Pricing](https://github.com/pricing)
- [API](https://docs.github.com)
- [Training](https://services.github.com)
- [Blog](https://github.blog)
- [About](https://github.com/about)

 You can’t perform that action at this time.

```

```

&lt;script crossorigin="anonymous" async="async" integrity="sha512-5AFAN1ydvGHphMD/LuiVufTeDdrVfeqJ9lEPKx9p2e65t4rSpPKMkSPilIcKBFuESiWkoOLcndYreqDbYCCcZg==" type="application/javascript" src="[https://github.githubassets.com/assets/diffs-e4014037.js"&gt;&lt;/script&gt;](https://github.githubassets.com/assets/diffs-e4014037.js">)&lt;script crossorigin="anonymous" async="async" integrity="sha512-AAA2jGQdfutTTwRtgVUxmx8IWUG5ojtM6eL+lLn8oi+SMpmTSL5og4qdaARc+v2+sh9/OGOebjl3OHARm0LG9A==" type="application/javascript" src="[https://github.githubassets.com/assets/github-0000368c.js"&gt;&lt;/script&gt;](https://github.githubassets.com/assets/github-0000368c.js">) You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

```

```

We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products.

```
          Learn more.

          Accept
          Reject

```

We use optional third-party analytics cookies to understand how you use GitHub.com so we can build better products.

```

          You can always update your selection by clicking Cookie Preferences at the bottom of the page.
          For more information, see our Privacy Statement.

          Essential cookies
          We use essential cookies to perform essential website functions, e.g. they're used to log you in.
            Learn more

          Always active

          Analytics cookies
          We use analytics cookies to understand how you use our websites so we can make them better, e.g. they're used to gather information about the pages you visit and how many clicks you need to accomplish a task.
            Learn more

            Accept
            Reject

        Save preferences

```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 78.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~16 days

Recently: every ~66 days

Total

24

Last Release

2089d ago

Major Versions

v0.1.9 → v1.0.02019-11-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/99859aa94dd7ca0fe2173c8a38e418d6b17969fd9caf60420a2a8231d1bc4f4c?d=identicon)[cheng0\_0di](/maintainers/cheng0_0di)

---

Top Contributors

[![milewski](https://avatars.githubusercontent.com/u/2874967?v=4)](https://github.com/milewski "milewski (29 commits)")[![niunaiyi-code](https://avatars.githubusercontent.com/u/178618828?v=4)](https://github.com/niunaiyi-code "niunaiyi-code (2 commits)")[![ChengDi666](https://avatars.githubusercontent.com/u/56573987?v=4)](https://github.com/ChengDi666 "ChengDi666 (2 commits)")[![xoco70](https://avatars.githubusercontent.com/u/5855577?v=4)](https://github.com/xoco70 "xoco70 (1 commits)")[![eugenefvdm](https://avatars.githubusercontent.com/u/1836436?v=4)](https://github.com/eugenefvdm "eugenefvdm (1 commits)")[![dgoldstein89](https://avatars.githubusercontent.com/u/53494117?v=4)](https://github.com/dgoldstein89 "dgoldstein89 (1 commits)")[![bernhardh](https://avatars.githubusercontent.com/u/642292?v=4)](https://github.com/bernhardh "bernhardh (1 commits)")

---

Tags

laravelcollapsenovasidebarcollapsible

### Embed Badge

![Health badge](/badges/norgeit-collapsible-resource-manager/health.svg)

```
[![Health](https://phpackages.com/badges/norgeit-collapsible-resource-manager/health.svg)](https://phpackages.com/packages/norgeit-collapsible-resource-manager)
```

###  Alternatives

[digital-creative/collapsible-resource-manager

A custom sidebar menu with collapsible groups

199904.2k1](/packages/digital-creative-collapsible-resource-manager)[optimistdigital/nova-multiselect-field

A multiple select field for Laravel Nova.

3453.7M8](/packages/optimistdigital-nova-multiselect-field)[inspheric/nova-defaultable

Default values for Nova fields when creating resources and running resource actions.

52178.7k1](/packages/inspheric-nova-defaultable)[datomatic/nova-detached-actions

A Laravel Nova tool to allow for placing actions in the Nova toolbar detached from the checkbox selection mechanism.

11273.0k](/packages/datomatic-nova-detached-actions)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
