Skip to content

Updated mixed typings #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions dist/js/field.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
2 changes: 1 addition & 1 deletion dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"/js/field.js": "/js/field.js"
}
}
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
"production": "mix --production"
},
"devDependencies": {
"cross-env": "^5.0.0",
"laravel-mix": "^1.0",
"laravel-nova": "^1.0"
"laravel-mix": "^6.0",
"vue-loader": "^16.0.2"
},
"dependencies": {
"axios": "^0.18.0",
"vue": "^2.5.0"
"vue": "^3.0"
}
}
4 changes: 3 additions & 1 deletion resources/js/field.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import IndexField from "./components/IndexField";

Nova.booting((Vue, router) => {
Vue.component('index-duplicate-field', require('./components/IndexField'));
Vue.component('index-duplicate-field', IndexField);
})
2 changes: 1 addition & 1 deletion src/DuplicateField.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DuplicateField extends Field
*/
public $component = 'duplicate-field';

public function __construct(string $name, ? string $attribute = null, ? mixed $resolveCallback = null)
public function __construct(string $name, ? string $attribute = null, mixed $resolveCallback = null)
{
parent::__construct(null, null, null);

Expand Down
4 changes: 2 additions & 2 deletions src/Http/Controllers/DuplicateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

namespace Jackabox\DuplicateField\Http\Controllers;

use Illuminate\Http\Request;
use Laravel\Nova\Http\Requests\NovaRequest;
use Illuminate\Routing\Controller;

class DuplicateController extends Controller
{
/**
* Duplicate a nova field and all of the relations defined.
*/
public function duplicate(Request $request)
public function duplicate(NovaRequest $request)
{
// Replicate the model
$model = $request->model::where('id', $request->id)->first();
Expand Down
9 changes: 8 additions & 1 deletion webpack.mix.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
let mix = require("laravel-mix");

mix.setPublicPath("dist").js("resources/js/field.js", "js");
mix.setPublicPath("dist")
.js('resources/js/field.js', 'js')
.vue({ version: 3 })
.webpackConfig({
externals: {
vue: 'Vue',
},
})