forked from dcasia/collapsible-resource-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add readme, prepare for first release
- Loading branch information
Showing
12 changed files
with
249 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019 Digital Creative | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Collapsible Resource Manager | ||
|
||
[![Latest Version on Packagist](https://img.shields.io/packagist/v/digital-creative/collapsible-resource-manager.svg)](https://packagist.org/packages/digital-creative/collapsible-resource-manager) | ||
[![Total Downloads](https://img.shields.io/packagist/dt/digital-creative/collapsible-resource-manager.svg)](https://packagist.org/packages/digital-creative/collapsible-resource-manager) | ||
[![License](https://img.shields.io/packagist/l/digital-creative/collapsible-resource-manager.svg)](https://github.com/digital-creative/collapsible-resource-manager/blob/master/LICENSE) | ||
|
||
![Laravel Nova Collapsible Resource Manager in action](https://github.com/dcasia/collapsible-resource-manager/screenshoots/demo-1.png) | ||
|
||
Provides an easy way to order and group your resources on the sidebar. | ||
|
||
# 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.` | ||
|
||
```php | ||
class NovaServiceProvider extends NovaApplicationServiceProvider | ||
{ | ||
public function tools() | ||
{ | ||
return [ | ||
// ... | ||
new CollapsibleResourceManager() | ||
]; | ||
|
||
} | ||
} | ||
``` | ||
|
||
Publish the configuration file | ||
|
||
```bash | ||
php artisan vendor:publish --provider="DigitalCreative\CollapsibleResourceManager\CollapsibleResourceManagerServiceProvider" --tag="config" | ||
``` | ||
|
||
Config file reference: | ||
|
||
```php | ||
return [ | ||
/** | ||
* If false the default resource manager will coexist with this tool | ||
*/ | ||
'disable_default_resource_manage' => true, | ||
|
||
/** | ||
* If true all titles within navigation array will pass through laravel trans helper | ||
*/ | ||
'translate_title' => false, | ||
|
||
/** | ||
* Main navigation, each item on this array creates a new entry on the sidebar with an icon | ||
*/ | ||
'navigation' => [ | ||
[ | ||
'title' => 'Resource Title', | ||
'icon' => null, //<svg></svg> or <img src=""/> | ||
'groups' => [ | ||
[ | ||
'title' => 'Group Title', | ||
'expanded' => true, | ||
'resources' => [ | ||
\App\Nova\User::class, | ||
] | ||
] | ||
] | ||
] | ||
] | ||
]; | ||
``` | ||
|
||
# Notes | ||
|
||
A key difference between `CollapsibleResourceManager` and the default Nova `ResourceManager` is that the later auto scan | ||
for resources within the `App\Nova` directory and adds it to the navigation, `CollapsibleResourceManager` expects | ||
every entry to be added manually from the configuration file. | ||
|
||
## License | ||
|
||
The MIT License (MIT). Please see [License File](https://github.com/dcasia/collapsible-resource-manager/raw/master/LICENSE) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
return [ | ||
/** | ||
* If false the default resource manager will coexist with this tool | ||
*/ | ||
'disable_default_resource_manage' => true, | ||
|
||
/** | ||
* If true all titles within navigation array will pass through laravel trans helper | ||
*/ | ||
'translate_title' => false, | ||
|
||
/** | ||
* Main navigation, each item on this array creates a new entry on the sidebar with an icon | ||
*/ | ||
'navigation' => [ | ||
[ | ||
'title' => 'Resource Title', | ||
'icon' => null, //<svg></svg> or <img src=""/> | ||
'groups' => [ | ||
[ | ||
'title' => 'Group Title', | ||
'expanded' => true, | ||
'resources' => [ | ||
\App\Nova\User::class, | ||
] | ||
] | ||
] | ||
] | ||
] | ||
]; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
<collapsible-resource-manager :groups='@json($groups)' title="{{ $title }}" icon="{{ $icon }}"> | ||
</collapsible-resource-manager> | ||
@foreach($navigation as $group) | ||
|
||
<collapsible-resource-manager :data='@json($group)'></collapsible-resource-manager> | ||
|
||
@endforeach |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.