-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
3,078 additions
and
1 deletion.
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,12 @@ | ||
/.idea | ||
/node_modules | ||
/vendor | ||
.DS_Store | ||
.phpunit.result.cache | ||
auth.json | ||
composer.phar | ||
composer.lock | ||
package-lock.json | ||
phpunit.xml | ||
Thumbs.db | ||
yarn.lock |
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 +1,86 @@ | ||
# laravel-nova-collapsible-sidebar | ||
# Laravel Nova Collapsible Sidebar | ||
|
||
 | ||
 | ||
|
||
## About | ||
|
||
This is a collapsible sidebar for Laravel Nova 2. | ||
|
||
## Installation | ||
|
||
To install the sidebar run the following command in your Laravel Nova project: | ||
|
||
```bash | ||
composer require pos-lifestyle/laravel-nova-collapsible-sidebar | ||
``` | ||
|
||
## Usage | ||
|
||
Copy the Laravel Nova layout template `vendor/laravel/nova/resources/views/layout.blade.php` to | ||
`resources/views/vendor/nova/layout.blade.php`. | ||
|
||
```bash | ||
mkdir -p resources/views/vendor/nova | ||
cp -r vendor/laravel/nova/resources/views/layout.blade.php resources/views/vendor/nova/layout.blade.php | ||
``` | ||
|
||
In `resources/views/vendor/nova/layout.blade.php` you will find the sidebar which looks like this: | ||
|
||
```html | ||
<!-- Sidebar --> | ||
<div class="min-h-screen flex-none pt-header min-h-screen w-sidebar bg-grad-sidebar px-6"> | ||
<a href="{{ \Laravel\Nova\Nova::path() }}"> | ||
<div class="absolute pin-t pin-l pin-r bg-logo flex items-center w-sidebar h-header px-6 text-white"> | ||
@include('nova::partials.logo') | ||
</div> | ||
</a> | ||
|
||
@foreach (\Laravel\Nova\Nova::availableTools(request()) as $tool) | ||
{!! $tool->renderNavigation() !!} | ||
@endforeach | ||
</div> | ||
``` | ||
|
||
Replace the ordinary `div` tag by `collapsible-sidebar`: | ||
|
||
```html | ||
<collapsible-sidebar class="min-h-screen flex-none pt-header min-h-screen w-sidebar bg-grad-sidebar px-6"> | ||
... | ||
</collapsible-sidebar> | ||
``` | ||
|
||
Now you can toggle the sidebar by clicking the icon on the top right of the sidebar. The sidebar automatically expands | ||
when you move the mouse pointer over the sidebar. | ||
|
||
## Configuration | ||
|
||
To save the state, add `persist` to the `collapsible-sidebar` tag. | ||
|
||
```html | ||
<collapsible-sidebar class="..." persist> | ||
... | ||
</collapsible-sidebar> | ||
``` | ||
|
||
To show the trigger only when you move the mouse pointer over the sidebar, add `shy-trigger` to the | ||
`collapsible-sidebar` tag. | ||
|
||
```html | ||
<collapsible-sidebar class="..." shy-trigger> | ||
... | ||
</collapsible-sidebar> | ||
``` | ||
|
||
## Screenshots | ||
|
||
<table> | ||
<tr> | ||
<td><strong>Expanded</strong></td> | ||
<td><strong>Collapsed</strong></td> | ||
</tr> | ||
<tr> | ||
<td><img src="docs/assets/img/collapsible-sidebar-expanded.png" alt="Collapsible sidebar (expanded)"></td> | ||
<td><img src="docs/assets/img/collapsible-sidebar-collapsed.png" alt="Collapsible sidebar (collapsed)"></td> | ||
</tr> | ||
</table> |
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,54 @@ | ||
{ | ||
"name": "pos-lifestyle/laravel-nova-collapsible-sidebar", | ||
"description": "A Laravel Nova collapsible sidebar.", | ||
"keywords": [ | ||
"laravel", | ||
"nova", | ||
"sidebar", | ||
"navigation", | ||
"collapsible" | ||
], | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Jan Hähne", | ||
"email": "[email protected]", | ||
"homepage": "https://github.com/jhae-de", | ||
"role": "Developer" | ||
} | ||
], | ||
"support": { | ||
"issues": "https://github.com/pos-lifestyle/laravel-nova-collapsible-sidebar/issues" | ||
}, | ||
"repositories": [ | ||
{ | ||
"type": "composer", | ||
"url": "https://nova.laravel.com" | ||
} | ||
], | ||
"require": { | ||
"php": "^7.1", | ||
"laravel/framework": "^5.8 || ^6.0", | ||
"laravel/nova": "^2.0" | ||
}, | ||
"require-dev": { | ||
"roave/security-advisories": "dev-master" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"PosLifestyle\\CollapsibleSidebar\\": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"PosLifestyle\\CollapsibleSidebar\\ToolServiceProvider" | ||
] | ||
} | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
2,671 changes: 2,671 additions & 0 deletions
2,671
dist/fonts/vendor/font-awesome/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"/js/collapsible-sidebar.js": "/js/collapsible-sidebar.js?id=92e333d35670599afb04", | ||
"/css/collapsible-sidebar.css": "/css/collapsible-sidebar.css?id=ee37005613840405cbfa", | ||
"/js/collapsible-sidebar.js.map": "/js/collapsible-sidebar.js.map?id=499e883bb9bf0903dd23", | ||
"/css/collapsible-sidebar.css.map": "/css/collapsible-sidebar.css.map?id=ff2102fd11ebe5f7c39b" | ||
} |
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.
Oops, something went wrong.