Skip to content

Commit 199fb1c

Browse files
Merge pull request #53 from crynobone/nova5
Nova 5 Integration
2 parents 22685aa + fee7d23 commit 199fb1c

File tree

25 files changed

+566
-74
lines changed

25 files changed

+566
-74
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
* text=auto
2+
3+
# Ignore following folder/file.
4+
/.github export-ignore
5+
/tests export-ignore
6+
/workbench export-ignore
7+
/.gitattributes export-ignore
8+
/.gitignore export-ignore
9+
/testbench.yaml export-ignore

composer.json

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,31 @@
1616
}
1717
],
1818
"repositories": [
19-
{
20-
"type": "composer",
21-
"url": "https://nova.laravel.com"
22-
}
19+
{
20+
"type": "composer",
21+
"url": "https://nova.laravel.com"
22+
}
2323
],
2424
"require": {
2525
"php": "^8.1",
2626
"laravel/nova": "^5.0",
2727
"spatie/laravel-permission": "^6.0"
2828
},
29+
"require-dev": {
30+
"laravel/nova-devtool": "^1.2"
31+
},
2932
"autoload": {
3033
"psr-4": {
3134
"Sereny\\NovaPermissions\\": "src/"
3235
}
3336
},
37+
"autoload-dev": {
38+
"psr-4": {
39+
"Workbench\\App\\": "workbench/app/",
40+
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
41+
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
42+
}
43+
},
3444
"extra": {
3545
"laravel": {
3646
"providers": [
@@ -43,5 +53,19 @@
4353
},
4454
"config": {
4555
"sort-packages": true
56+
},
57+
"scripts": {
58+
"post-autoload-dump": [
59+
"@clear",
60+
"@prepare"
61+
],
62+
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
63+
"prepare": "@php vendor/bin/testbench package:discover --ansi",
64+
"build": "@php vendor/bin/testbench workbench:build --ansi",
65+
"serve": [
66+
"Composer\\Config::disableProcessTimeout",
67+
"@build",
68+
"@php vendor/bin/testbench serve --ansi"
69+
]
4670
}
4771
}

dist/js/tool.js

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

dist/js/tool.js.LICENSE.txt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
/*!
2-
* The buffer module from node.js, for the browser.
3-
*
4-
* @author Feross Aboukhadijeh <http://feross.org>
5-
* @license MIT
6-
*/
7-
8-
/*!
9-
* vuex v4.1.0
10-
* (c) 2022 Evan You
11-
* @license MIT
12-
*/
13-
14-
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
15-
161
/**
172
* @license
183
* Lodash <https://lodash.com/>

nova.mix.js

Lines changed: 0 additions & 33 deletions
This file was deleted.

package.json

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,14 @@
77
"watch-poll": "mix watch -- --watch-options-poll=1000",
88
"hot": "mix watch --hot",
99
"prod": "npm run production",
10-
"production": "mix --production",
11-
"nova:install": "npm --prefix='../../vendor/laravel/nova' ci"
10+
"production": "mix --production"
1211
},
1312
"devDependencies": {
14-
"@inertiajs/inertia": "^0.11.1",
15-
"@vue/babel-plugin-jsx": "^1.2.5",
16-
"@vue/compiler-sfc": "^3.5.13",
17-
"axios": "^1.7.9",
18-
"laravel-mix": "^6.0.49",
13+
"laravel-nova-devtool": "file:vendor/laravel/nova-devtool",
14+
"vue-loader": "^16.8.3"
15+
},
16+
"dependencies": {
1917
"lodash": "^4.17.21",
20-
"postcss": "^8.4.49",
21-
"vue-loader": "^17.4.2",
22-
"vuex": "^4.1.0"
18+
"vue": "^3.5.13"
2319
}
2420
}

resources/js/components/DetailField.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@
77
{{ __(group) }}
88
</h1>
99
<div class="grid grid-cols-4 gap-4">
10-
<div v-for="(permission, option) in permissions" :key="option">
10+
<div v-for="(permission, option) in permissions" :key="option" class="flex items-center">
1111
<Icon
12-
viewBox="0 0 24 24"
13-
width="24"
14-
height="24"
15-
:type="hasPermission(permission.option) ? 'check-circle' : 'x-circle'"
12+
:name="hasPermission(permission.option) ? 'check-circle' : 'x-circle'"
1613
:class="hasPermission(permission.option) ? 'text-green-500' : 'text-red-500'"
14+
class="inline-block"
1715
/>
1816
<span class="ml-1">{{ permission.label }}</span>
1917
</div>
@@ -25,7 +23,10 @@
2523
</template>
2624

2725
<script>
26+
import { Icon } from 'laravel-nova-ui';
27+
2828
export default {
29+
components: { Icon },
2930
props: [
3031
'resource',
3132
'resourceName',

resources/js/components/IndexField.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</template>
1111

1212
<script>
13-
import { flatMap } from 'lodash';
13+
import flatMap from 'lodash/flatMap';
1414
1515
export default {
1616
props: [

src/NovaPermissions.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ public function boot()
6464
Gate::policy(config('permission.models.permission'), $this->permissionPolicy);
6565
Gate::policy(config('permission.models.role'), $this->rolePolicy);
6666

67-
Nova::script('nova-permissions', __DIR__.'/../dist/js/tool.js');
68-
Nova::style('nova-permissions', __DIR__.'/../dist/css/tool.css');
67+
Nova::mix('nova-permissions', __DIR__.'/../dist/mix-manifest.json');
6968
}
7069

7170
/**

testbench.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
laravel: '@testbench'
2+
3+
providers:
4+
- Laravel\Nova\NovaServiceProvider
5+
- Laravel\Nova\NovaCoreServiceProvider
6+
- Workbench\App\Providers\NovaServiceProvider
7+
- Spatie\Permission\PermissionServiceProvider
8+
- Sereny\NovaPermissions\ToolServiceProvider
9+
# - Workbench\App\Providers\WorkbenchServiceProvider
10+
11+
migrations: true
12+
13+
seeders:
14+
- Workbench\Database\Seeders\DatabaseSeeder
15+
- Workbench\Database\Seeders\RolesAndPermissionsSeeder
16+
17+
workbench:
18+
start: /nova
19+
build:
20+
- package:discover
21+
- asset-publish
22+
- create-sqlite-db
23+
- db:wipe
24+
- migrate:refresh
25+
assets:
26+
- migrations
27+
- nova-assets
28+
sync: []
29+
30+
purge:
31+
directories:
32+
- lang/*
33+
- public/vendor/*

0 commit comments

Comments
 (0)