Skip to content

Commit 23d2cc9

Browse files
authored
Support Nova 4 (#58)
1 parent 1dee94b commit 23d2cc9

22 files changed

+5642
-10566
lines changed

README.md

+6-15
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,26 @@ The signature is the same as the default `MorphTo` field that ships with Nova.
1818

1919
```php
2020
use DigitalCreative\InlineMorphTo\InlineMorphTo;
21-
use DigitalCreative\InlineMorphTo\HasInlineMorphToFields;
2221

2322
class Article extends Resource
2423
{
25-
use HasInlineMorphToFields;
26-
2724
public function fields(Request $request)
2825
{
2926
return [
3027
...
31-
InlineMorphTo::make('Template')
32-
->types([
33-
\App\Nova\Video::class,
34-
\App\Nova\Image::class,
35-
\App\Nova\Text::class,
36-
\App\Nova\Gallery::class,
37-
])
38-
->default(\App\Nova\Text::class),
28+
InlineMorphTo::make('Template')->types([
29+
\App\Nova\Video::class,
30+
\App\Nova\Image::class,
31+
\App\Nova\Text::class,
32+
\App\Nova\Gallery::class,
33+
]),
3934
...
4035
];
4136

4237
}
4338
}
4439
```
4540

46-
**_Note:_** You will need to import the `HasInlineMorphToFields` trait for this field to display correctly within resource detail views.
47-
48-
**_Code example_**: adding morphables dynamically from a directory [#4](https://github.com/dcasia/nova-inline-morph-to/issues/4)
49-
5041
## License
5142

5243
The MIT License (MIT). Please see [License File](https://raw.githubusercontent.com/dcasia/nova-inline-morph-to/master/LICENSE) for more information.

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
],
1717
"license": "MIT",
1818
"require": {
19-
"php": ">=7.1.0"
19+
"php": "^7.3|^8.0",
20+
"laravel/nova": "^4.0"
2021
},
2122
"autoload": {
2223
"psr-4": {

dist/js/field.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/field.js.LICENSE.txt

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
/*!
2-
* Determine if an object is a Buffer
2+
* The buffer module from node.js, for the browser.
33
*
4-
* @author Feross Aboukhadijeh <https://feross.org>
4+
* @author Feross Aboukhadijeh <http://feross.org>
55
* @license MIT
66
*/
77

8-
/**
9-
* @license
10-
* Lodash <https://lodash.com/>
11-
* Copyright JS Foundation and other contributors <https://js.foundation/>
12-
* Released under MIT license <https://lodash.com/license>
13-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
14-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
8+
/*!
9+
* vuex v4.1.0
10+
* (c) 2022 Evan You
11+
* @license MIT
1512
*/
13+
14+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
15+
16+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

nova.mix.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
const mix = require('laravel-mix')
2+
const webpack = require('webpack')
3+
const path = require('path')
4+
5+
class NovaExtension {
6+
name() {
7+
return 'nova-extension'
8+
}
9+
10+
register(name) {
11+
this.name = name
12+
}
13+
14+
webpackConfig(webpackConfig) {
15+
webpackConfig.externals = {
16+
vue: 'Vue',
17+
}
18+
19+
webpackConfig.resolve.alias = {
20+
...(webpackConfig.resolve.alias || {}),
21+
'laravel-nova': path.join(__dirname, '../../vendor/laravel/nova/resources/js/mixins/packages.js'),
22+
'@/storage': path.resolve(__dirname, './resources/js/storage'),
23+
'@': path.resolve(__dirname, '../../vendor/laravel/nova/resources/js/'),
24+
}
25+
26+
webpackConfig.output = {
27+
uniqueName: this.name,
28+
}
29+
}
30+
}
31+
32+
mix.extend('nova', new NovaExtension())

0 commit comments

Comments
 (0)