Skip to content

Commit 80774a9

Browse files
committed
Nova 4 Support
0 parents  commit 80774a9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+9240
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2

.eslintrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"extends": [
3+
"eslint:recommended",
4+
"plugin:vue/essential",
5+
"prettier"
6+
],
7+
"parserOptions": {
8+
"ecmaVersion": 2017
9+
},
10+
"globals": {
11+
"Nova": true
12+
},
13+
"env": {
14+
"browser": true,
15+
"node": true
16+
},
17+
"rules": {
18+
"vue/html-indent": ["error", 4]
19+
}
20+
}

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# Mac OS X
4+
.DS_Store
5+
._.*
6+
._*
7+
8+
# Ignore local editor
9+
.project
10+
.settings
11+
/.idea
12+
/.vscode
13+
*.swp
14+
tags
15+
nbproject/*
16+
17+
# Windows
18+
Thumbs.db
19+
20+
auth.json
21+
npm-debug.log
22+
yarn-error.log
23+
24+
.env
25+
.env.backup
26+
phpunit.xml
27+
.phpunit.result.cache
28+
docker-compose.override.yml
29+
Homestead.json
30+
Homestead.yaml
31+
32+
config/version.yml
33+
34+
package-lock.json
35+
composer.phar
36+
composer.lock
37+
yarn.lock
38+
39+
_ide_helper.php
40+
_ide_helper_models.php
41+
.phpstorm.meta.php
42+
lighthouse-audit*
43+
.nova
44+
45+
/node_modules
46+
/vendor
47+
/packages

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Release Notes
2+
3+
## v3.0

CONTRIBUTING.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Contributing
2+
3+
Contributions are **welcome** and will be fully **credited**.
4+
5+
Please read and understand the contribution guide before creating an issue or pull request.
6+
7+
## Etiquette
8+
9+
This project is open source, and as such, the maintainers give their free time to build and maintain the source code
10+
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
11+
extremely unfair for them to suffer abuse or anger for their hard work.
12+
13+
Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
14+
world that developers are civilized and selfless people.
15+
16+
It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
17+
quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.
18+
19+
## Viability
20+
21+
When requesting or submitting new features, first consider whether it might be useful to others. Open
22+
source projects are used by many developers, who may have entirely different needs to your own. Think about
23+
whether or not your feature is likely to be used by other users of the project.
24+
25+
## Procedure
26+
27+
Before filing an issue:
28+
29+
- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
30+
- Check to make sure your feature suggestion isn't already present within the project.
31+
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
32+
- Check the pull requests tab to ensure that the feature isn't already in progress.
33+
34+
Before submitting a pull request:
35+
36+
- Check the codebase to ensure that your feature doesn't already exist.
37+
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
38+
39+
## Requirements
40+
41+
If the project maintainer has any additional requirements, you will find them listed here.
42+
43+
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
44+
45+
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
46+
47+
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
48+
49+
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
50+
51+
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
52+
53+
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
54+
55+
**Happy coding**!

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Artem Stepanenko
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Filemanager tool for Laravel Nova
2+
3+
[![Latest Version on Packagist](https://img.shields.io/packagist/v/stepanenko3/nova-filemanager.svg?style=flat-square)](https://packagist.org/packages/stepanenko3/nova-filemanager)
4+
[![Total Downloads](https://img.shields.io/packagist/dt/stepanenko3/nova-filemanager.svg?style=flat-square)](https://packagist.org/packages/stepanenko3/nova-filemanager)
5+
[![License](https://poser.pugx.org/stepanenko3/nova-filemanager/license)](https://packagist.org/packages/stepanenko3/nova-filemanager)
6+
7+
A Filemanager Tool and Field for Laravel Nova
8+
9+
##### Filemanager Tool preview
10+
11+
![FileManager Tool](https://user-images.githubusercontent.com/42798230/44862985-d3d57b80-ac73-11e8-9169-2e76a3584ea4.gif)
12+
13+
##### Filemanager Field preview
14+
15+
![FileManager Field](https://user-images.githubusercontent.com/42798230/44864362-5f9cd700-ac77-11e8-9e0f-330d18a81598.gif)
16+
17+
18+
### Installation
19+
20+
```bash
21+
composer require stepanenko3/nova-filemanager
22+
```
23+
24+
### Docs
25+
26+
[https://stepanenko3.github.io/nova-filemanager/](https://stepanenko3.github.io/nova-filemanager)
27+
28+
29+
### Testing
30+
31+
``` bash
32+
yarn lint
33+
yarn check-format
34+
```
35+
36+
### Changelog
37+
38+
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
39+
40+
## Contributing
41+
42+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
43+
44+
### Security
45+
46+
If you discover any security related issues, please using the issue tracker.
47+
48+
## Credits
49+
50+
- [Artem Stepanenko](https://github.com/stepanenko3)
51+
- [Eric Lagarda](https://github.com/Krato)
52+
- [Spatie Nova Tool Skeleton](https://github.com/spatie/skeleton-nova-tool)
53+
54+
## License
55+
56+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

composer.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "stepanenko3/nova-filemanager",
3+
"description": "Filemanager tool for Laravel Nova",
4+
"keywords": [
5+
"laravel",
6+
"nova",
7+
"filemanager"
8+
],
9+
"license": "MIT",
10+
"authors": [
11+
{
12+
"name": "Artem Stepanenko",
13+
"email": "[email protected]",
14+
"role": "Maintainer & Developer"
15+
}
16+
],
17+
"require": {
18+
"php": ">=7.1.0",
19+
"laravel/nova": "^4.0"
20+
},
21+
"repositories": [
22+
{
23+
"type": "path",
24+
"url": "../nova"
25+
}
26+
],
27+
"autoload": {
28+
"psr-4": {
29+
"Stepanenko3\\NovaFilemanager\\": "src/"
30+
}
31+
},
32+
"extra": {
33+
"laravel": {
34+
"providers": [
35+
"Stepanenko3\\NovaFilemanager\\FilemanagerServiceProvider"
36+
]
37+
}
38+
},
39+
"config": {
40+
"sort-packages": true
41+
},
42+
"minimum-stability": "dev",
43+
"prefer-stable": true
44+
}

config/nova-filemanager.php

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Filemanager Disk
8+
|--------------------------------------------------------------------------
9+
| This is the storage disk FileManager will use to put file uploads, you can use
10+
| any of the disks defined in your config/filesystems.php file. Default to public.
11+
*/
12+
'disk' => env('FILEMANAGER_DISK', 'public'),
13+
14+
/*
15+
|--------------------------------------------------------------------------
16+
| Filemanager default order
17+
|--------------------------------------------------------------------------
18+
| This will set the default order of the files and folders.
19+
| You can use mime, name or size. Default to mime
20+
*/
21+
'order' => env('FILEMANAGER_ORDER', 'mime'),
22+
23+
/*
24+
|--------------------------------------------------------------------------
25+
| Filemanager default order direction
26+
|--------------------------------------------------------------------------
27+
| This will set the default order direction of the files and folders.
28+
| You can use asc or desc. Default to asc
29+
*/
30+
'direction' => env('FILEMANAGER_DIRECTION', 'asc'),
31+
32+
/*
33+
|--------------------------------------------------------------------------
34+
| Filemanager cache
35+
|--------------------------------------------------------------------------
36+
| This will set the cache of filemenager. Filemanager creates a md5 using file
37+
| info. This is useful when s3 is being used or when needs to read a lot of files.
38+
| Cache is set by file, not by folder. Default to false.
39+
*/
40+
'cache' => env('FILEMANAGER_CACHE', false),
41+
42+
/*
43+
|--------------------------------------------------------------------------
44+
| Configurable buttons
45+
|--------------------------------------------------------------------------
46+
| This will hide or show filemanager buttons. You can enable o disable buttons
47+
| as your own needs. True means visible. False hidden.
48+
*/
49+
'buttons' => [
50+
51+
// Menu
52+
'create_folder' => true,
53+
'upload_button' => true,
54+
'select_multiple' => true,
55+
56+
// Folders
57+
'rename_folder' => true,
58+
'delete_folder' => true,
59+
60+
// Files
61+
'rename_file' => true,
62+
'delete_file' => true,
63+
'download_file' => true,
64+
65+
],
66+
67+
/*
68+
|--------------------------------------------------------------------------
69+
| Filemanager filters
70+
|--------------------------------------------------------------------------
71+
| This option let you to filter your files by extensions.
72+
| You can create|modify|delete as you want.
73+
*/
74+
75+
'filters' => [
76+
77+
'Images' => ['jpg', 'jpeg', 'png', 'gif', 'svg', 'bmp', 'tiff'],
78+
79+
'Documents' => ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pps', 'pptx', 'odt', 'rtf', 'md', 'txt', 'css'],
80+
81+
'Videos' => ['mp4', 'avi', 'mov', 'mkv', 'wmv', 'flv', '3gp', 'h264'],
82+
83+
'Audios' => ['mp3', 'ogg', 'wav', 'wma', 'midi'],
84+
85+
'Compressed' => ['zip', 'rar', 'tar', 'gz', '7z', 'pkg'],
86+
87+
],
88+
89+
/*
90+
|--------------------------------------------------------------------------
91+
| Filemanager default filter
92+
|--------------------------------------------------------------------------
93+
| This will set the default filter for all your Filemanager. You should use one
94+
| of the keys used in filters in lowercase. If you have a key called Documents,
95+
| use 'documents' as your default filter. Default to false
96+
*/
97+
'filter' => false,
98+
99+
/*
100+
|--------------------------------------------------------------------------
101+
| Naming strategy
102+
|--------------------------------------------------------------------------
103+
| Resolve the upload file name with a class that extends
104+
| Stepanenko3\NovaFilemanager\Http\Services\AbstractNamingStrategy
105+
*/
106+
'naming' => Stepanenko3\NovaFilemanager\Http\Services\DefaultNamingStrategy::class,
107+
108+
/*
109+
|--------------------------------------------------------------------------
110+
| Post Processing jobs of files
111+
|--------------------------------------------------------------------------
112+
| You can set post upload jobs for each file uploaded. You should use one
113+
| of the keys used in filters in lowercase. If you have a key called Documents,
114+
| use 'documents' as your default filter.
115+
*/
116+
'jobs' => [],
117+
118+
'iconSize' => 48,
119+
];

dist/js/field.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)