Skip to content
Merged
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
13 changes: 10 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
{
"name": "dillingham/nova-attach-many",
"name": "letsgoi/nova-attach-many",
"type": "library",
"description": "Attach Many Nova field",
"keywords": [
"laravel",
"nova"
],
"license": "MIT",
"repositories": [
{
"type": "composer",
"url": "https://nova.laravel.com"
}
],
"require": {
"php": "^7.3|^8.0",
"laravel/nova": "^4",
"laravel/framework": "^8.0|^9.0"
"laravel/nova": "^4.0",
"laravel/framework": "^8.0|^9.0|^10.0"
},
"autoload": {
"psr-4": {
Expand Down
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: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/js/field.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* vuex v4.0.2
* (c) 2021 Evan You
* vuex v4.1.0
* (c) 2022 Evan You
* @license MIT
*/

Expand Down
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/field.js": "/js/field.js"
"/js/field.js": "/js/field.js",
"/css/field.css": "/css/field.css"
}
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3'
services:
node:
image: node:20-alpine
working_dir: /var/www
volumes:
- ./:/var/www:cached
composer:
image: composer
working_dir: /var/www
volumes:
- ./:/var/www:cached
- ~/.ssh:/root/.ssh:cached
- ~/.composer:/root/.composer:delegated
2 changes: 1 addition & 1 deletion mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class NovaExtension {
...(webpackConfig.resolve.alias || {}),
'laravel-nova': path.join(
__dirname,
'../../vendor/laravel/nova/resources/js/mixins/packages.js'
'vendor/laravel/nova/resources/js/mixins/packages.js'
),
}

Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
"production": "mix --production",
"nova:install": "npm --prefix='vendor/laravel/nova' ci"
},
"devDependencies": {
"@vue/compiler-sfc": "^3.2.22",
"laravel-mix": "^6.0.41",
"postcss": "^8.3.11",
"vue-loader": "^16.8.3"
},
"dependencies": {}
"tailwindcss": "^3.3.3",
"vue-loader": "^17.2.2"
}
}
14 changes: 13 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Belongs To Many create & edit form UI for Nova. Enables attaching relationships
### Installation

```bash
composer require dillingham/nova-attach-many
composer require letsgoi/nova-attach-many
```

### Usage
Expand Down Expand Up @@ -113,6 +113,18 @@ This field also respects policies: ie Role / Permission

---

# Development
Install dependencies:
```bash
docker compose run node npm install
docker compose run composer install
docker compose run node npm run nova:install
```
Compile assets for production:
```bash
docker compose run node npm run production
```

# Author

Hi 👋, Im Brian D. I created this Nova package [and others](https://novapackages.com/collaborators/dillingham)
Expand Down
2 changes: 2 additions & 0 deletions resources/css/field.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@tailwind components;
@tailwind utilities;
2 changes: 1 addition & 1 deletion resources/js/components/FormField.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<DefaultField :field="currentField" :full-width-content="currentField.fullWidth" :show-help-text="false">
<template #field :class="{'border-danger border': hasErrors}">
<div class="attach-many-container" :class="{'border-danger border': hasErrors}">
<div class="nova-attach-many" :class="{'border-danger border': hasErrors}">
<div v-if="currentField.showToolbar" class="flex items-center border border-b-0 border-gray-100 dark:border-gray-700">
<div v-if="preview" class="flex justify-center p-3 w-full">
<div class="text-xl">{{ __('Selected Items') }} ({{ selected.length }})</div>
Expand Down
1 change: 1 addition & 0 deletions src/Providers/FieldServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function boot()

Nova::serving(function (ServingNova $event) {
Nova::script('nova-attach-many', __DIR__.'/../../dist/js/field.js');
Nova::style('nova-attach-many', __DIR__.'/../../dist/css/field.css');
});
}

Expand Down
12 changes: 12 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
content: [
"./resources/**/*.blade.php",
"./resources/**/*.js",
'./resources/js/**/*.vue',
],
theme: {
extend: {},
},
plugins: [],
important: '.nova-attach-many'
}
7 changes: 5 additions & 2 deletions webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ require('./mix')
mix
.setPublicPath('dist')
.js('resources/js/field.js', 'js')
.vue({ version: 3 })
.nova("dillingham/nova-attach-many")
.vue({version: 3})
.postCss('resources/css/field.css', 'css', [
require("tailwindcss"),
])
.nova('letsgoi/nova-attach-many')