Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdiunal committed Jun 27, 2024
0 parents commit a56f9d0
Show file tree
Hide file tree
Showing 114 changed files with 11,769 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/.idea
/vendor
/node_modules
package-lock.json
composer.phar
composer.lock
phpunit.xml
.phpunit.result.cache
.DS_Store
Thumbs.db
bun.lockb
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Ferdi ÜNAL

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.
71 changes: 71 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Laravel Nova Media Field

## WIP (Work In Progress)

This package aims to provide a field for Laravel Nova that integrates with the Spatie Media Library. It is currently under development and will soon be updated with more features and documentation.

### Install

```bash
composer require ferdiunal/laravel-nova-media-field
```

### Usage

```php
/**
* Get the fields displayed by the resource.
*
* @return array
*/
public function fields(NovaRequest $request)
{
return [
ID::make()->sortable(),
MediaField::make('Logo', 'logo')
->required()
->multiple()
->vapor()
->withResponsive()
->validate(
minSize: 30, // The allowed extensions for the file.
maxSize: 1024 * 50, // The allowed mime types for the file.
size: 1024 * 50, // The minimum size of the file.
image: false, // The maximum size of the file.
video: false, // The size of the file.
audio: false, // Whether to allow only image files.
document: false, // Whether to allow only video files.
pdf: false, // Whether to allow only audio files.
txt: false, // Whether to allow only document files.
json: false, // Whether to allow only PDF files.
csv: false, // Whether to allow only text files.
xlsx: false, // Whether to allow only JSON files.
docx: false, // Whether to allow only CSV files.
creation: false, // Whether to allow only XLSX files.
update: false, // Whether to allow only DOCX files.
default: false, // Whether to apply the rules for creation.
allowedExtensions: [], // Whether to apply the rules for update.
allowedMimeTypes: [] // Whether to apply the rules as default.
)
];
}

```

### Screenshots
<img src="./pictures/SCR-20240627-mdrz.png" width="70%">
<img src="./pictures/SCR-20240627-mdtu.png" width="70%">
<img src="./pictures/SCR-20240627-mdxj.png" width="70%">
<img src="./pictures/SCR-20240627-meab.png" width="70%">
<img src="./pictures/SCR-20240627-mebx.png" width="70%">
<img src="./pictures/SCR-20240627-meie.png" width="70%">
<img src="./pictures/SCR-20240627-meke.png" width="70%">
<img src="./pictures/SCR-20240627-mffm.png" width="70%">
<img src="./pictures/SCR-20240627-mfhq.png" width="70%">
<img src="./pictures/SCR-20240627-mfpi.png" width="70%">
<img src="./pictures/SCR-20240627-mhsm.png" width="70%">
<img src="./pictures/SCR-20240627-mhvj.png" width="70%">
<img src="./pictures/SCR-20240627-mieo.png" width="70%">
<img src="./pictures/SCR-20240627-miig.png" width="70%">
<img src="./pictures/SCR-20240627-mijz.png" width="70%">
<img src="./pictures/SCR-20240627-miqd.png" width="70%">
70 changes: 70 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "ferdiunal/laravel-nova-media-field",
"description": "A Laravel Nova media field for Spatie's media library",
"keywords": [
"laravel",
"nova",
"media",
"spatie",
"medialibrary",
"nova-media-field"
],
"authors": [
{
"name": "Ferdi Ünal",
"email": "[email protected]",
"homepage": "https://gitub.com/ferdiunal",
"role": "Developer"
}
],
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/ferdiunal"
},
{
"type": "buymeacoffee",
"url": "https://buymeacoffee.com/ferdiunal"
}
],
"license": "MIT",
"repositories": [
{
"type": "composer",
"url": "https://nova.laravel.com"
}
],
"require": {
"php": "^8.2",
"laravel/framework": "^10.0|^11.0",
"laravel/nova": "^4.0",
"laravel/vapor-core": "^2.37",
"spatie/laravel-medialibrary": "^10.0|^11.0"
},
"require-dev": {
"laravel/pint": "^1.16",
"spatie/laravel-ray": "^1.36"
},
"autoload": {
"psr-4": {
"Ferdiunal\\NovaMediaField\\": "src/"
}
},
"extra": {
"laravel": {
"providers": [
"Ferdiunal\\NovaMediaField\\NovaMediaFieldServiceProvider"
]
}
},
"scripts": {
"pint": [
"./vendor/bin/pint"
]
},
"config": {
"sort-packages": true
},
"minimum-stability": "stable",
"prefer-stable": true
}
1 change: 1 addition & 0 deletions dist/css/field.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/js/field.js

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions dist/js/field.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <http://feross.org>
* @license MIT
*/

/*!
* vuex v4.1.0
* (c) 2022 Evan You
* @license MIT
*/

/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */

/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
4 changes: 4 additions & 0 deletions dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"/js/field.js": "/js/field.js",
"/css/field.css": "/css/field.css"
}
Loading

0 comments on commit a56f9d0

Please sign in to comment.