Skip to content

Commit

Permalink
Add Nova 4 support (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
milewski authored Oct 23, 2023
1 parent 56c5ac6 commit 2f089ab
Show file tree
Hide file tree
Showing 27 changed files with 5,805 additions and 9,882 deletions.
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: milewski
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
/.idea
/vendor
/node_modules
composer.phar
phpunit.xml
.phpunit.result.cache
.DS_Store
Thumbs.db
composer.lock
package-lock.json
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) 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.
69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Nova Value Widget

[![Latest Version on Packagist](https://img.shields.io/packagist/v/digital-creative/value-widget)](https://packagist.org/packages/digital-creative/value-widget)
[![Total Downloads](https://img.shields.io/packagist/dt/digital-creative/value-widget)](https://packagist.org/packages/digital-creative/value-widget)
[![License](https://img.shields.io/packagist/l/digital-creative/value-widget)](https://github.com/dcasia/value-widget/blob/main/LICENSE)

<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/dcasia/value-widget/main/screenshots/dark.png">
<img alt="Nova Welcome Card in Action" src="https://raw.githubusercontent.com/dcasia/value-widget/main/screenshots/light.png">
</picture>

A simple widget for laravel [nova-dashboard](https://github.com/dcasia/nova-dashboard).

# Installation

You can install the package via composer:

```
composer require digital-creative/value-widget
```

## Basic Usage

```php
use DigitalCreative\NovaDashboard\Filters;
use DigitalCreative\ValueWidget\ValueWidget;
use Laravel\Nova\Http\Requests\NovaRequest;

class MyWidget extends ValueWidget
{
public function configure(NovaRequest $request): void
{
$this->icon('<svg></svg> or heroicons name');
$this->title('My Widget');
$this->textColor(dark: '#845adf', light: '#845adf');
$this->backgroundColor('#845adf4f');
}

public function value(Filters $filters): mixed
{
//
}
}
```

## ⭐️ Show Your Support

Please give a ⭐️ if this project helped you!

### Other Packages You Might Like

- [Nova Welcome Card](https://github.com/dcasia/nova-welcome-card) - A configurable version of the `Help card` that comes with Nova.
- [Icon Action Toolbar](https://github.com/dcasia/icon-action-toolbar) - Replaces the default boring action menu with an inline row of icon-based actions.
- [Expandable Table Row](https://github.com/dcasia/expandable-table-row) - Provides an easy way to append extra data to each row of your resource tables.
- [Collapsible Resource Manager](https://github.com/dcasia/collapsible-resource-manager) - Provides an easy way to order and group your resources on the sidebar.
- [Resource Navigation Tab](https://github.com/dcasia/resource-navigation-tab) - Organize your resource fields into tabs.
- [Resource Navigation Link](https://github.com/dcasia/resource-navigation-link) - Create links to internal or external resources.
- [Nova Mega Filter](https://github.com/dcasia/nova-mega-filter) - Display all your filters in a card instead of a tiny dropdown!
- [Nova Pill Filter](https://github.com/dcasia/nova-pill-filter) - A Laravel Nova filter that renders into clickable pills.
- [Nova Slider Filter](https://github.com/dcasia/nova-slider-filter) - A Laravel Nova filter for picking range between a min/max value.
- [Nova Range Input Filter](https://github.com/dcasia/nova-range-input-filter) - A Laravel Nova range input filter.
- [Nova FilePond](https://github.com/dcasia/nova-filepond) - A Nova field for uploading File, Image and Video using Filepond.
- [Custom Relationship Field](https://github.com/dcasia/custom-relationship-field) - Emulate HasMany relationship without having a real relationship set between resources.
- [Column Toggler](https://github.com/dcasia/column-toggler) - A Laravel Nova package that allows you to hide/show columns in the index view.
- [Batch Edit Toolbar](https://github.com/dcasia/batch-edit-toolbar) - Allows you to update a single column of a resource all at once directly from the index page.

## License

The MIT License (MIT). Please see [License File](https://raw.githubusercontent.com/dcasia/value-widget/master/LICENSE) for more information.
16 changes: 12 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
{
"name": "digital-creative/value-widget",
"description": "A Laravel Nova tool.",
"description": "A basic widget for laravel nova-dashboard.",
"keywords": [
"laravel",
"nova"
"nova",
"nova-dashboard",
"widget"
],
"authors": [
{
"name": "Rafael Milewski"
}
],
"license": "MIT",
"require": {
"php": ">=7.1.0"
"php": ">=8.1",
"laravel/nova": "^4.0"
},
"autoload": {
"psr-4": {
Expand All @@ -17,7 +25,7 @@
"extra": {
"laravel": {
"providers": [
"DigitalCreative\\ValueWidget\\ToolServiceProvider"
"DigitalCreative\\ValueWidget\\ValueWidgetServiceProvider"
]
}
},
Expand Down
1 change: 1 addition & 0 deletions dist/css/card.css

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

1 change: 1 addition & 0 deletions dist/js/card.js

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

1 change: 0 additions & 1 deletion dist/js/widget.js

This file was deleted.

12 changes: 0 additions & 12 deletions dist/js/widget.js.LICENSE.txt

This file was deleted.

3 changes: 2 additions & 1 deletion dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"/js/widget.js": "/js/widget.js"
"/js/card.js": "/js/card.js",
"/css/card.css": "/css/card.css"
}
30 changes: 30 additions & 0 deletions nova.mix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const mix = require('laravel-mix')
const webpack = require('webpack')
const path = require('path')

class NovaExtension {
name() {
return 'nova-extension'
}

register(name) {
this.name = name
}

webpackConfig(webpackConfig) {
webpackConfig.externals = {
vue: 'Vue',
}

webpackConfig.resolve.alias = {
...(webpackConfig.resolve.alias || {}),
'laravel-nova': path.join(__dirname, '../../vendor/laravel/nova/resources/js/mixins/packages.js'),
}

webpackConfig.output = {
uniqueName: this.name,
}
}
}

mix.extend('nova', new NovaExtension())
Loading

0 comments on commit 2f089ab

Please sign in to comment.